Skip to content

Instantly share code, notes, and snippets.

View dalbrekt's full-sized avatar

Tony Dalbrekt dalbrekt

  • https://github.com/dalbrekt/
View GitHub Profile
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
@dalbrekt
dalbrekt / vim.md
Created April 23, 2015 18:15
Vim setup

Patogen package manager

curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim```

## Setup
Add to vimrc:

```execute pathogen#infect()```
/**
* Scala IoC - Value injection on traits
*/
case class Car(id: Long, year: Int, brand: String)
trait CarDao {
def save(car: Car): Unit
def findBy(id: Long): Option[Car]
@dalbrekt
dalbrekt / git-hooks.md
Last active August 17, 2021 13:05
Git hooks

1. Enable git templates:

$ git config --global init.templatedir '~/.git-templates'

This tells git to copy everything in ~/.git-templates to your per-project .git/ directory when you run git init

2. Create a directory to hold the global hooks:

@dalbrekt
dalbrekt / tmux-cheat.md
Last active December 14, 2015 23:09
tmux cheat sheet

Tmux

List all key bindings

Ctrl-b ?

Open command prompt

Ctrl-b :
@dalbrekt
dalbrekt / AsciiDoc.java
Created December 3, 2012 12:10 — forked from mojavelinux/AsciiDoc.java
Execute AsciiDoc from Java using the Jython Interpreter
import java.io.*;
import javax.script.*;
import org.python.core.PySystemState;
import org.python.core.PyString;
import org.python.util.PythonInterpreter;
/**
* This class executes the AsciiDoc python scripts (asciidoc.py and a2x.py) from
* Java using the Jython interpreter.
*
@dalbrekt
dalbrekt / gist:1894937
Created February 23, 2012 20:39 — forked from kritzikratzi/gist:1275419
Another way to use play-morphia blobs
package models;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;
import play.libs.MimeTypes;
import play.modules.morphia.Blob;