Skip to content

Instantly share code, notes, and snippets.

@partkyle
partkyle / the_silver_searcher
Last active December 11, 2018 13:07
install the silver searcher locally
# requires apt-get install -y automake pkg-config libpcre3-dev zlib1g-dev liblzma-dev
set -e
VERSION=0.16
export LOCAL=$HOME/local
mkdir -p $HOME/build
cd $HOME/build
@partkyle
partkyle / build-zsh.sh
Last active December 18, 2015 18:19 — forked from nicoulaj/build-zsh.sh
update git url
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://git.code.sf.net/p/zsh/code
cd zsh
def running_avg():
total = float((yield))
count = 1
while True:
total += yield total / count
count += 1
avg = running_avg()
avg.next()
@partkyle
partkyle / custom_fields_generator.rb
Created December 12, 2012 22:28
custom_fields.rb
module CustomFieldsGenerator
# generate a number of custom fields based on the `@@field_types`
# this is to simulate a list upload
def self.generate(count)
pre_hash = @@field_enumerator.take(count)
Hash[pre_hash]
end
@@field_types = {
@partkyle
partkyle / secret_santa.rb
Created December 10, 2012 19:17
secret santa script in ruby with example
require 'faker'
require 'enumerator'
class SecretSanta
def initialize(data)
@data = data
end
def perform
while !valid?
@partkyle
partkyle / delegates.coffee
Created November 23, 2012 23:57
Coffeescript Delegates
class Something
constructor: ->
@delegateObject = new Messager
class Messager
testing: (int) ->
console.log int
woot: (bool) ->
console.log bool
nothing: (array) ->
@partkyle
partkyle / dotfiles
Created September 25, 2012 21:48
Load my Dotfiles
git clone [email protected]:partkyle/prezto .zprezto
# link the prezto files
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
@partkyle
partkyle / vim_install
Created July 17, 2012 00:33
VM Setup
#!/bin/sh
if [ -z "$VIM_VERSION"]; then
VIM_VERSION=v7-3-603
fi
hg clone https://vim.googlecode.com/hg/ vim
cd vim
hg pull
hg update
@partkyle
partkyle / gist:2224038
Created March 28, 2012 05:50 — forked from robashton/gist:874187
Another naive game loop
function runApplication(){
setInterval(doGameLoop, 1000 / 30);
}
function doGameLoop(){
doLogic();
renderScene();
}
// Basic function definition
function function_name (argument) {
// body...
}
function function_name (argument)
{
// body...
}