Skip to content

Instantly share code, notes, and snippets.

View jasonmp85's full-sized avatar
📚
Learning

Jason Petersen jasonmp85

📚
Learning
View GitHub Profile
@jasonmp85
jasonmp85 / do_work.c
Created February 5, 2014 20:36
Parallelism Test
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
static const int ITERATIONS = 2134113216;
static double do_work(int worker_num, int concurrency)
{
int chunk_size = ITERATIONS / concurrency;
int start_num = chunk_size * worker_num;
#!/bin/bash
set -eux
sudo apt-get update
packages="postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"
# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
sudo update-alternatives --remove-all postmaster.1.gz
#!/bin/sh
# script to add apt.postgresql.org to sources.list
# from command like
CODENAME="$1"
# lsb_release is the best interface, but not always available
if [ -z "$CODENAME" ]; then
CODENAME=$(lsb_release -cs 2>/dev/null)
fi
@jasonmp85
jasonmp85 / keybase.md
Created August 21, 2014 00:36
keybase.md

Keybase proof

I hereby claim:

  • I am jasonmp85 on github.
  • I am jasonmp85 (https://keybase.io/jasonmp85) on keybase.
  • I have a public key whose fingerprint is 1577 6413 8A99 5721 48D7 7316 9286 A83A 9387 E546

To claim this, I am signing this object:

@jasonmp85
jasonmp85 / call_sorter.rb
Last active August 29, 2015 14:14
Organizing C
#!/usr/bin/env ruby
require 'tsort'
require 'awesome_print'
# Quick-and-dirty wrapper around cflow to sort functions in a file
func_refs = {}
func_lvls = {}
cflow_cmd = %w[cflow -i_ -l --format=posix
--level-indent=1
#!/usr/bin/env bash
sed 's|/Users/USERNAME/Dropbox/Public/|http\://dl\.dropbox\.com/u/3423/|g';
sed 's|file\://localhost/Users/USERNAME/Dropbox/Public/|http\://dl\.dropbox\.com/u/3423/|g';
sed 's|\~/Dropbox/Public/|http\://dl\.dropbox\.com/u/3423/|g';
sed 's|\.\./Public/|http\://dl\.dropbox\.com/u/3423/|g';
@jasonmp85
jasonmp85 / rails_3_1_rc4_changes.md
Created August 14, 2011 04:34 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@jasonmp85
jasonmp85 / trello_hours.js
Created December 8, 2011 18:09 — forked from avaynshtok/trello_hours.js
Calculate Sprint Hours in Trello
// copy this to a bookmark URL to use as a bookmarklet:
// javascript:document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).setAttribute('src','https://raw.github.com/gist/1447877/trello_hours.js')
(function() {
var boardId = _.last(location.href.split('/'));
/**
* If a card starts with a string like "[4]", this method returns the
* first number in the brackets. Otherwise it returns zero.
*/
@jasonmp85
jasonmp85 / scrumy_hours.js
Created April 5, 2012 00:57
Calculate Sprint Hours in Scrumy
// copy the following to a bookmark URL to use as a bookmarklet
// replace PROJECT_NAME and PASSWORD as appropriate
// javascript:window.scrumyProjectName="PROJECT_NAME",window.scrumyPassword="PASSWORD";document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).setAttribute('src','https://raw.github.com/gist/2306992/scrumy_hours.js')
/*
Scrumy API JavaScript Client v0.5.0
Released under the MIT License
*/
((function(){})).call(this),function(){function A(a,b,c){if(a===b)return a!==0||1/a==1/b;if(a==null||b==null)return a===b;a._chain&&(a=a._wrapped),b._chain&&(b=b._wrapped);if(a.isEqual&&w.isFunction(a.isEqual))return a.isEqual(b);if(b.isEqual&&w.isFunction(b.isEqual))return b.isEqual(a);var d=i.call(a);if(d!=i.call(b))return!1;switch(d){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:a==0?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.mult
@jasonmp85
jasonmp85 / sum_hours.js
Created April 13, 2012 19:28 — forked from cayblood/scrumy.com hour script
Display Scrumy Hours in Lanes
// use this in a bookmarklet to make a button for this script:
// javascript:document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).setAttribute('src','https://raw.github.com/gist/2379456/sum_hours.js')
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return