Skip to content

Instantly share code, notes, and snippets.

Jacob Burenstam buren

Block or report user

Report or block buren

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@buren
buren / keybase.md
Created Aug 26, 2015
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am buren on github.
  • I am buren (https://keybase.io/buren) on keybase.
  • I have a public key whose fingerprint is 323D 61B6 0AC7 6D5D AAE3 9F9B 1C12 24B1 298D BF94

To claim this, I am signing this object:

@buren
buren / zsh-git-prompt
Last active Aug 29, 2015
zsh-git-prompt
View zsh-git-prompt
# Shameless steal from http://askubuntu.com/a/85111
# git branch in zsh-prompt
echo '
autoload -Uz vcs_info
precmd () { vcs_info }
setopt prompt_subst
PS1="\$vcs_info_msg_0_$PS1"' >> ~/.zshrc
@buren
buren / RetryableCall.rb
Created Apr 16, 2014
Retry given block until response is not nil or max_retries is reached
View RetryableCall.rb
class RetryableCall
DEFAULT_OPTIONS = {
sleep: 0.5,
max_retries: 5
}
def self.perform options = {}, &block
new(options).perform(&block)
end
View keybase.md

Keybase proof

I hereby claim:

  • I am buren on github.
  • I am buren (https://keybase.io/buren) on keybase.
  • I have a public key whose fingerprint is EBA4 FF7D C0DF C205 02B8 9A24 C85F B75E 410E 4CC4

To claim this, I am signing this object:

@buren
buren / Singelton.java
Created May 7, 2014
Simple Java Singelton Example
View Singelton.java
package utils;
import java.net.URL;
public class Enduro {
private static Enduro ourInstance = new Enduro();
public static Enduro getInstance() {
return ourInstance;
}
@buren
buren / gem_console.rb
Created Oct 5, 2014
Put this in the Gem's Rakefile.
View gem_console.rb
# https://gist.github.com/buren-trialbee/f51c6d37ea96618bcc49
task :console do
require 'irb'
require 'irb/completion'
require 'my_gem'
ARGV.clear
IRB.start
end
@buren
buren / meta_ruby.rb
Created Oct 22, 2014
Simple Ruby meta programming example
View meta_ruby.rb
class Meta
def self.make_method(meth_name)
define_method meth_name do |adjective|
puts "#{meth_name} is a #{adjective} method name"
end
end
def method_missing(meth, *args, &block)
puts "Method #{meth} is not defined on this class"
self.class.make_method(meth)
@buren
buren / send_hipchat_message.bash
Created Jan 26, 2015
Send message to private HipChat room using cURL
View send_hipchat_message.bash
ROOM_ID=yourroomname
OWNER_ID=XXXYYYX
AUTH_TOKEN=XXXYYYXXX
MESSAGE="Hello world!"
curl --header "content-type: application/json" --header "Authorization: Bearer $AUTH_TOKEN" -X POST \
-d "{\"name\":\"dev\",\"privacy\":\"private\",\"is_archived\":false,\"is_guest_accessible\":false,\"topic\":\"cURL\",\"message\":\"Message sent to HipChat from cURL\",\"color\":\"green\",\"owner\":{\"id\":$OWNER_ID}}" https://api.hipchat.com/v2/room/$ROOM_ID/notification
View countCSSRules.js
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
View permute_name.rb
require 'set'
last = (ARGV.shift || fail('<int> Permute of last n chars must be set')).to_i
seed = ARGV
fail 'At least one seed must be provided' if seed.empty?
def say(name)
puts name
`say #{name}`
You can’t perform that action at this time.