Skip to content

Instantly share code, notes, and snippets.

View dogeared's full-sized avatar
🏠
Working from home

Micah Silverman dogeared

🏠
Working from home
View GitHub Profile
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
@dogeared
dogeared / PRAssigned.rb
Last active December 15, 2015 02:59
Show who's assigned to which pull NOTE: you may have to install the json gem if you don't already have it. sudo gem install json
#! /usr/bin/ruby
#
require 'rubygems'
require 'json'
require 'open-uri'
user = 'YOUR GITHUB USERNAME'
pass = 'YOUR GITHUB PASSWORD'
repo = 'workmarket/application'
module.exports = function(data) {
var _data = data
var filter = {
byType: function(query) {
// alter _data
return this
},
byName: function(query) {
// alter _data
"SELECT * FROM meetings WHERE meetingID = '1';"
"SELECT * FROM meetingAddress WHERE meetingID = '1';"
"SELECT * FROM districts WHERE districtID = '1';"
var _ = require('underscore')
var levers = [
{ id: '1', val: 'one'},
{ id: '2', val: 'two'},
{ id: '3', val: 'three'},
]
var ids = ['1', '3']
function minutes_since_last_commit {
now=`date +%s`
last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
if [ "$?" -ne "0" ]; then
minutes_since_last_commit=-1
else
seconds_since_last_commit=$((now-last_commit))
minutes_since_last_commit=$((seconds_since_last_commit/60))
fi
echo $minutes_since_last_commit
@dogeared
dogeared / gist:1560822
Created January 4, 2012 16:31
Trello card counter (until there's an API)
// Instructions:
// (1) Browse to your favorite Trello board
// (2) Drop this into your friendly Chrome inspector or Firefox Firebug console
$('.list').each(function(index) {
var outer = $(this);
$(this).find('h2.current').each(function(index) {
console.log($(this).text() + ': ' + outer.find('.list-card').length)
})
})
@dogeared
dogeared / gist:1268518
Created October 6, 2011 20:12
Java copyOfRagne example
import java.util.*;
public class t {
public static void main(String[] args) {
String[] s = {"1", "2", "3"};
String[] t = Arrays.copyOfRange(s, 1, 3);
System.out.println("Length of t: " + t.length);
System.out.println(t[0]);
System.out.println(t[1]);
downloadReport: {
'default': function(reportFile, requestData, callback) {
var file = fs.createWriteStream(requestData.filename);
var downloadUrl = url.parse(requestData.reportingDownloadUrl);
var local = http.createClient(443, downloadUrl.host, secure=true);
requestData.headers['host'] = downloadUrl.host;
var request = local.request('GET', downloadUrl.pathname + downloadUrl.search, requestData.headers);
request.on('response', function (response) {
@dogeared
dogeared / gist:816380
Created February 8, 2011 12:37
Replacement code in NodeService
public String post(Service serviceName, Map<String, String> params) throws IOException {
StringBuffer sb = new StringBuffer();
for (String key:params.keySet()) {
String value = params.get(key);
sb.append(key+"="+value+"&");
}
String urlParameters = sb.substring(0,sb.length()-1);
URL url;