Skip to content

Instantly share code, notes, and snippets.

View jtescher's full-sized avatar

Julian Tescher jtescher

View GitHub Profile
@jtescher
jtescher / gist:1487555
Created December 16, 2011 19:31
Capistrano task: Optimize images with pngcrush and jpegoptim
namespace :image_compression do
desc 'Optimize images with pngcrush and jpegoptim'
task :process do
# Check for pngcrush
if (!`which pngcrush`.empty? rescue false) # rescue on environments without `which` (windows)
# Crush all .png files
run "find #{shared_path}/assets/ -type f -name '*.png' -print0 | xargs -0 pngcrush -q -e .crushed"
@jtescher
jtescher / gist:3183389
Created July 26, 2012 17:36
zsh-theme
PROMPT='%3~$(git_prompt_info)%# '
ZSH_THEME_GIT_PROMPT_PREFIX="["
ZSH_THEME_GIT_PROMPT_SUFFIX="]"
@jtescher
jtescher / gist:5059049
Created February 28, 2013 18:41
Amazon EC2 Instance private IP addresses
ec2-describe-instances --region us-west-2 | grep INSTANCE | awk {'print $5'} | awk -F"." '{print $1}'
@jtescher
jtescher / outdated_gems.sh
Created March 21, 2013 23:54
Determine outdated gems without listing dependencies of dependencies
#!/bin/bash
bundle outdated | awk '{print($2)}' | while read line
do
if grep -q "gem '$line'" Gemfile; then
echo $line
fi
done
@jtescher
jtescher / neo4j-enterprise.rb
Created June 10, 2013 20:13
Neo4j Enterprise Homebrew Formula
require 'formula'
class Neo4jEnterprise < Formula
homepage 'http://www.neo4j.org/'
url 'http://dist.neo4j.org/neo4j-enterprise-1.9-unix.tar.gz'
sha1 '66e7da3d5f94b210d78a573fa8f4f8c0897cd2c3'
version 'enterprise-1.9-unix'
devel do
url 'http://dist.neo4j.org/neo4j-enterprise-2.0.0-M02-unix.tar.gz'
@jtescher
jtescher / messages.log
Created January 28, 2014 21:37
Neo4j Recovery Problem
###### SERVER ID 123 (Slave) ######
2014-01-28 21:15:30.828+0000 DEBUG [o.n.c.p.a.m.ProposerState$2]: ProposerState: proposer-[promise]->proposer from:cluster://10.10.1.251:5001 instance:614 conversation-id:123/944#
2014-01-28 21:15:30.828+0000 DEBUG [o.n.c.p.a.m.AcceptorState$2]: AcceptorState: acceptor-[accept]->acceptor from:cluster://10.10.1.102:5001 instance:614 conversation-id:123/944#
2014-01-28 21:15:30.828+0000 DEBUG [o.n.c.p.a.m.ProposerState$2]: ProposerState: proposer-[accepted]->proposer from:cluster://10.10.1.102:5001 instance:614 conversation-id:123/944#
2014-01-28 21:15:30.828+0000 DEBUG [o.n.c.p.a.m.ProposerState$2]: ProposerState: proposer-[accepted]->proposer from:cluster://10.10.1.251:5001 instance:614 conversation-id:123/944#
2014-01-28 21:15:30.829+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: Learned and closed instance 614 from conversation 123/944# and the content was Change cluster config, elected:272 as coordinator
2014-01-28 21:15:30.829+0000 DEBUG [o.n.c.p.a.m.LearnerState$2]: LearnerS
@jtescher
jtescher / gist:d7f62b420033195420d2
Created August 30, 2014 00:49
Keybase Verification
### Keybase proof
I hereby claim:
* I am jtescher on github.
* I am jatescher (https://keybase.io/jatescher) on keybase.
* I have a public key whose fingerprint is 9DD4 EEC2 8FA9 13E0 6697 286D 11DC A6F5 E7F5 F787
To claim this, I am signing this object:
/*
This example uses Scala. Please see the MLlib documentation for a Java example.
Try running this code in the Spark shell. It may produce different topics each time (since LDA includes some randomization), but it should give topics similar to those listed above.
This example is paired with a blog post on LDA in Spark: http://databricks.com/blog
Spark: http://spark.apache.org/
*/
import scala.collection.mutable
### Keybase proof
I hereby claim:
* I am jtescher on github.
* I am jatescher (https://keybase.io/jatescher) on keybase.
* I have a public key whose fingerprint is 8543 5B5D 1390 03CB E188 6DD0 9C80 429A 2FEF 6220
To claim this, I am signing this object:
class Walker {
int x;
int y;
Walker () {
x = width / 2;
y = height / 2;
}
void display() {