Skip to content

Instantly share code, notes, and snippets.

View krujos's full-sized avatar

Joshua Kruck krujos

View GitHub Profile
@krujos
krujos / Gemfile
Created August 5, 2013 16:17 — forked from danhigham/Gemfile
source :rubygems
gem 'cfoundry'
gem 'uuidtools'
@krujos
krujos / main.js.
Created November 8, 2013 15:57
ngGrid + angular dynamic cell text based off row value. I had to pad the number of rows in a ngGrid to achieve some consistency in our UI. That meant that where I was using cell templates to create links for action on a row I had to stop inserting text when we had an empty row. In order to do this I shoved an angular directive that calls a scope…
$scope.getCellText = function(key) {
if ( key ) {
return "Do stuff";
}
};
$scope.theData = {};
$scope.theGrid = {
data: 'theData',
columnDefs:
#!/home/mqtester/.rvm/wrappers/ruby-1.9.2-p290@mqtester/ruby
# encoding: utf-8
require "rubygems"
require "amqp"
@exchange_name = "amq.rabbitmq.trace"
class Consumer
def handle_message(metadata, payload)

tmux cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Keybase proof

I hereby claim:

  • I am krujos on github.
  • I am krujos (https://keybase.io/krujos) on keybase.
  • I have a public key whose fingerprint is 00E3 37A8 EB67 FB39 40BC C251 DCB6 BAFB 6CA7 484A

To claim this, I am signing this object:

@krujos
krujos / Dockerfile
Created October 10, 2014 04:40
Dockerfile to build on top of postgres, brittle and gross, but works by more or less reimplementing the entry point.
FROM postgres:9.3
MAINTAINER krujos
ENV PGDATA /var/lib/postgresql/data #Why do I need this?
RUN chown -R postgres "$PGDATA"; gosu postgres initdb; sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf ; { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf
RUN ( chown -R postgres "$PGDATA"; gosu postgres postgres & sleep 2 ; psql -U postgres -c "create user schedule_user;"; psql -U postgres -c "alter user schedule_user password 'schedule_password';"; psql -U postgres -c "create database schedule with owner schedule_user;"; )
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 5432
/**
* Checks if everything except id's and results are equal!
* An example of using the stream operator and a couple of gauva and apache
* language extensions to implement an equality check. We create a pair for
* each thing we want to compare then stream through and assert that
* everything matches the equality test. We use the hash code in the
* equality test as it's a little less finicky for equality tests. This is a
* pretty expensive and heavy weight implementation, not because of the
* functional stuff, but because of all the intermediary objects created. As
* this is example code we don't sweat the efficiency. A simpler
@krujos
krujos / convert.sh
Created November 13, 2014 02:09
Convert a directory full of tiffs to png
for f in *.tiff ; convert $f `(echo $f | sed -e 's/tiff/png/') `;
@krujos
krujos / sprint-boot-default-logger
Created December 20, 2014 01:08
Java log getter that i can never remember
import org.apache.log4j.Logger;
public class RedisCloudConfig extends AbstractCloudConfig {
private Logger log = Logger.getLogger(RedisCloudConfig.class);
//...
}
@krujos
krujos / OpsMgr export & Alias
Created January 17, 2015 22:55
Export and alias to have bosh command "just work"
export BUNDLE_GEMFILE=/home/tempest-web/tempest/web/bosh.Gemfile
alias bosh='bundle exec bosh'