Skip to content

Instantly share code, notes, and snippets.

View contolini's full-sized avatar
🐛
call me

Chris Contolini contolini

🐛
call me
View GitHub Profile
@contolini
contolini / gist:7d4f8717cb0cdb1144e7
Last active August 29, 2015 14:03
jumbo loan logic
// This is extremely un-DRY pseudo code
$( loan_amount, loan_type ).on('change', function(){
// Jumbo loans
if ( loan_type == 'conf' && loan_amount >= $417,000 ) {
$( county_dropdown ).show();
$( county_dropdown ).on('change', function(){
@contolini
contolini / gist:c580c48f98dc22cc6238
Last active August 29, 2015 14:04
fellowship pitch

CFPB is a consumer-centric federal agency that uses its dev and design skills to raise awareness of financial issues like student debt and discriminatory lending practices. We’re accepting applications for our 2015 technology fellowship and we’re looking for graphic designers, front-end devs, back-end devs, data scientists and UX experts. It's a two-year fellowship that starts in January 2015. Applications close soon, though, on July 31!

More info: http://www.consumerfinance.gov/jobs/technology-innovation-fellows/ (Scroll down for the verbose job descriptions)

Job logistics:

  • 100% remote (work from anywhere in the U.S. with occasional trips to DC to meet with teammates and subject matter experts)
  • It's a full-time gig with a solid salary (between $75k and $145k depending on experience and location).
  • Write open source code all day long. Legally, all code you write is in the Public Domain.
  • Federal benefits and opportunities to attend conferences like OSCON, Fluent, PyCon, OpenVis, Strange Loop
function one( foo ){
return $.ajax({
url: foo
});
}
function two( bar ){
return $.ajax({
url: bar
});
@contolini
contolini / .gitconfig
Last active August 29, 2015 14:14
`git emoji` alias that will use a random emoji as commit message
[alias]
# Random emoji commit message
emoji = "!git commit -am \"$(echo $(emoji-random)\"\")\""
config_files = Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf")
config_files.each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).each_line do |line|
line.strip!
@contolini
contolini / frontendbuild.sh
Created April 2, 2015 16:16
derequire band-aid
#!/bin/sh
set -ev
if [ ! -f config/config.json ]; then
cp config/example-config.json config/config.json
fi
npm install

Keybase proof

I hereby claim:

  • I am contolini on github.
  • I am contolini (https://keybase.io/contolini) on keybase.
  • I have a public key whose fingerprint is 7880 93C5 1D07 58EA 8843 D826 6AE7 8927 CF2F D0A3

To claim this, I am signing this object:

@contolini
contolini / glitch.js
Created April 29, 2015 17:13
29/4/2015 binarymax listserve
((function(f){"use strict";var bdy=window.top.document.body;bdy.innerHTML="";bdy.style.backgroundRepeat="repeat";var c=document.createElement("canvas");var d=c.getContext('2d');var e="";c.width=f;c.height=f;var g=d.createImageData(f,f);var h=[f*f];var i=[];var j=function(z){var a=g.data;for(var x=0;x<f;x++){for(var y=0;y<f;y++){var b=(x+y*f)*4;a[b+0]=(h[b].r*z)%255;a[b+1]=(h[b].g*z)%255;a[b+2]=(h[b].b*z)%255;a[b+3]=255}}d.putImageData(g,0,0);e=c.toDataURL();i.push('url('+e+')')};var k=0,dir=1;var l=function(){bdy.style.backgroundImage=i[k];k+=dir;if(k===f)dir=-1;if(k===0)dir=1};for(var x=0;x<f;x++){for(var y=0;y<f;y++){var m=(x+y*f)*4;h[m]={r:parseInt((x^y)),g:parseInt((x|y)),b:parseInt((x&y))}}}for(var z=0;z<f;z++){j(z)}setInterval(l,200)})(300))
@contolini
contolini / bookmarklet.js
Last active August 29, 2015 14:21
New PR bookmarklet
javascript:!function(){var a=document.getElementById("pull_request_body");a&&(a.value+="Short description explaining the high-level reason for the pull request\n\n## Additions\n\n- List of additions made\n- To the project\n- Within this PR\n\n## Removals\n\n- List of removals made\n- To the project\n- Within this PR\n\n## Changes\n\n- List of changes made\n- To the project\n- Within this PR\n\n## Testing\n\n- List of site urls\n- Or actions to take\n- To test the changes made\n\n## Review\n\n- @user\n- @user\n- @user\n\n## Preview\n\nInclude any screenshots that will make reviewing/testing easier\n\n[Preview this PR without the whitespace changes](?w=0)\n\n## Notes\n\n- List of notes about the changes that might be necessary\n- For the reviewer to know ahead of time or of related Github issues\n- Ex. Known issues or items outside the scope of the review\n- Ex. Fixes #100\n")}();
@contolini
contolini / --steps.md
Last active August 29, 2015 14:21
cf import test
  1. git clone git@gist.github.com:/f626d744a1e0a274c37c.git cf-import-test
  2. cd cf-import-test
  3. Start a local server and load index.html in a browser.
  4. Less should complain that a CF mixin isn't present.
  5. Install CF: bower install --save cfpb/capital-framework#dev
  6. Add @import 'vendor/capital-framework/src/capital-framework.less'; to the top of main.less.
  7. Reload the page and everything should look pretty.