Skip to content

Instantly share code, notes, and snippets.

View jackdesert's full-sized avatar

Jack Desert jackdesert

View GitHub Profile
@jackdesert
jackdesert / breadcrumb_helper.rb
Last active December 14, 2015 16:48 — forked from sprsquish/gist:445553
A helper method that creates a breadcrumb based on your current url
module Admin::BreadcrumbHelper
# BREADCRUMB HELPER
#
# This module is useful anywhere you want to create a basic bread crumb
# I generally use it
# INSTALLATION for ADMIN DASHBOARD
# 1. Save this file to app/helpers/admin/breadcrumb_helper
#
# INSTALLATION for NORMAL USE
# 1. Save this file to app/helpers/breadcrumb_helper
@jackdesert
jackdesert / gist:7090731
Last active December 26, 2015 04:09 — forked from hungpk/gist:5098340
This monkey patch of rails_admin allows me to set the timezone for rails_admin models explicitly, while the rest of the app runs on utc.
require 'rails_admin/config/fields/base'
module RailsAdmin
module Config
module Fields
module Types
class Datetime < RailsAdmin::Config::Fields::Base
def value
value_in_default_time_zone = bindings[:object].send(name)
WORTH FIXING
------------
This code is our pride and joy.
We write code EVERY DAY that depends on this
Our forward progress is impeded by this on a weekly basis
If this ever breaks, our reputation is at stake
We are regularly confused by this
We are not sure why it keeps breaking
We are not sure exactly what it does
@jackdesert
jackdesert / successful_taskwarrior_output.txt
Last active August 29, 2015 14:02
Successful output from from taskd server demo (client side)
dev@taskd3:~/tmp/taskd-1.0.0/demo/client$ ./run
--- case1 ---------------------------------------------------------------
--- list 1 --------------------------------------------------------------
Using alternate .taskrc file /home/dev/tmp/taskd-1.0.0/demo/client/tw1/rc
No matches.
--- sync 1 --------------------------------------------------------------
Using alternate .taskrc file /home/dev/tmp/taskd-1.0.0/demo/client/tw1/rc
Syncing with localhost:53589
Sync successful. No changes.
# Server Output
dev@taskd3:~/tmp/taskd-1.0.0/demo/server$ taskd server
s: INFO Server listening.
s: INFO connection from 76.115.175.209 port 52344
s: 2 ASSERT: gnutls_constate.c:695
s: 2 ASSERT: gnutls_db.c:238
s: 2 EXT[0xde9360]: Parsing extension 'SAFE RENEGOTIATION/65281' (1 bytes)
s: 2 EXT[0xde9360]: Parsing extension 'SIGNATURE ALGORITHMS/13' (10 bytes)
s: 2 EXT[SIGA]: rcvd signature algo (4.2) DSA-SHA256
@jackdesert
jackdesert / task_diagnostics.txt
Created June 24, 2014 20:32
task diagnostics 15"
vagrant@precise64:~/.task$ task diagnostics
task 2.3.0
Platform: Linux
Compiler
Version: 4.6.3
Caps: +stdc +stdc_hosted +200809 +LP64 +c1 +i4 +l8 +vp8
Build Features
@jackdesert
jackdesert / run_taskd_indefinitely.sh
Last active August 29, 2015 14:04
Wrapper Script for taskd
#! /bin/bash
# this script is just a wrapper around taskd so that taskd
# will start up again immediately if it ever dies
#
# The proper way to invoke this script is to call
# `nohup script/run_taskd_indefinitely.sh &`
# Note that this script requires that $TASKDDATA is set
@jackdesert
jackdesert / diagnostics.txt
Created January 24, 2015 20:06
task diagnostics with 2.4.0
vagrant@precise64:~$ task diagnostics
task 2.4.0
Platform: Linux
Compiler
Version: 4.6.3
Caps: +stdc +stdc_hosted +200809 +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: 1
@jackdesert
jackdesert / riak_1.4_stack_track
Created March 24, 2015 20:44
riak 1.4 stack trace
[" dictionary: [{reqstate,{wm_reqstate,{ssl,{sslsocket,new_ssl,<0.9876.5034>}},[{'content-encoding','identity'},{'content-type','application/json'},{mediaparams,[]},{resource_module,riak_kv_wm_object}],undefined,undefined,'54.158.216.244',{wm_reqdata,'POST',https,{1,1},'54.158.216.244','54.158.216.244',undefined,'4JHotrGIRVv3bi1fdaOHcVbwPD','/buckets/samples_instances_responses/keys','/buckets\n /samples_instances_responses/keys?returnbody=true',[{bucket,'samples_instances_responses'}],[],'../../..',{500,undefined},1073741824,67108864,[],[{'returnbody','true'}],{10,{'user-agent',{'User-Agent','Ruby'},{'content-length',{'Content-Length','258732'},{'connection',{'Connection','keep-alive'},{'accept',{'Accept','multipart/mixed, application/json;q=0.7, */\n *;q=0.5'},nil,nil},nil},{'host',{'Host','reporting-provider.p.cloudability.org:8080'},{'content-type',{'Content-Type','application/json'},nil,nil},nil}},{'x-forwarded-proto',{'X-Forwarded-Proto','https'},{'x-forwarded-port',{'X-Forwarded-Port','8080'},
package main
import (
"bufio"
"io/ioutil"
"log"
"os"
)
func main() {