Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"hash/fnv"
"sync"
)
const (
shardCount = 32
@JeffreyVdb
JeffreyVdb / .xbindkeysrc
Created April 20, 2015 11:08
Xbindkeysrc for elementary OS
# When pressing the overview button, open the multitasking view
"xte 'keydown Super_L' 'key S' 'keyup Super_L'"
b:10 + release
# Open urxvt when super + return key is pressed
"urxvtcd -e tmux"
m:0x50 + c:36
# When super and back forward, switch desktops
"xte 'key Right'"
@JeffreyVdb
JeffreyVdb / clean.sh
Created August 20, 2014 23:36
LinuxTools
#!/bin/bash
shopt -s dotglob
# clean up download folders
for d in /home/*/Downloads; do
echo "removing files in $d"
rm -rf $d/*
done
# Remove old kernels with magic
@JeffreyVdb
JeffreyVdb / ubuntu1404.sh
Last active July 14, 2016 06:24
PostInstall
#!/bin/bash
# Ubuntu 14.04 Gnome edition post install script
ADD_REPO="add-apt-repository -y"
RM="rm -f"
MKDIR="mkdir -p"
BITMAPPED_FONTS=1
LIQUORIX_KERNEL=1
NVIDIA_CLOSED_SOURCE=1
'require strict';
var http = require('http'),
url = require('url'),
fs = require('fs'),
util = require('util'),
exec = require('child_process').exec,
sh = require('execSync');
http.createServer(function (req, res) {
@JeffreyVdb
JeffreyVdb / postClone.sh
Last active August 29, 2015 14:03
Vagrant utils
#!/bin/bash
onRemote() {
vagrant ssh -c "cd /var/www; $*"
}
cd "$(git rev-parse --show-toplevel)/www"
vagrant up --provision
npm install
bower install
grunt all
#!/bin/bash
onRemote() {
vagrant ssh -c "cd /var/www; $*"
}
cd "$(git rev-parse --show-toplevel)/www"
vagrant up --provision
npm install
bower install
grunt all
#!/bin/bash
onRemote() {
vagrant ssh -c "cd /var/www; $*"
}
cd "$(git rev-parse --show-toplevel)/www"
vagrant up --provision
npm install
bower install
grunt clean && grunt all

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

@JeffreyVdb
JeffreyVdb / Directory tree
Last active August 29, 2015 14:02
manifest.json
locales
|-- admin
| |-- en-US.l20n
| `-- nl-NL.l20n
`-- manifest.json