Skip to content

Instantly share code, notes, and snippets.

View brycedorn's full-sized avatar

Bryce Dorn brycedorn

View GitHub Profile
@brycedorn
brycedorn / top_artists
Created May 28, 2013 20:44
The actual function as described in the tutorial on mah blog.
function top_artists(){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","http://ws.audioscrobbler.com/2.0/user/BDORN/weeklyartistchart.xml",false);
@brycedorn
brycedorn / apply_active_nav
Created May 5, 2014 17:40
apply_active_nav hack for bootstrap nav - fixes nav pills not reflecting routes
function apply_active_nav() {
var url = document.URL;
var nav = ['contact','about']; // Populate with all nav li classes
$.each(nav,function(i,val) {
var changed = false;
$('li.active').removeClass('active');
if(url.indexOf(nav[i]) > -1) {
$('li.active').removeClass('active');
$("li."+nav[i]).addClass("active");
changed = true;
@brycedorn
brycedorn / jkhtml
Created May 25, 2014 23:40
j/k scrolling on your blog
<script src="http://code.jquery.com/jquery-1.4.min.js"></script>
<script src="http://lilbtn.yjl.im/js/jquery/jquery.jknav.min.js"></script>
<script>
$(document).ready(function(){
$.jknav.init({
up: 'k',
down: 'j',
reevaluate: true
});
$('.post').jknav().addClass('jknav');
@brycedorn
brycedorn / proper_css_transitions
Created May 29, 2014 18:39
proper css transitions
<style>
.tran {
-webkit-transition: all .4s ease-in-out;
-moz-transition: all .4s ease-in-out;
-ms-transition: all .4s ease-in-out;
-o-transition: all .4s ease-in-out;
transition: all .4s ease-in-out;
}
#good:hover {
color: green;

Keybase proof

I hereby claim:

  • I am brycedorn on github.
  • I am burce (https://keybase.io/burce) on keybase.
  • I have a public key ASCWhZVKnX-FLm3njDAFxvLQrLv50XO8xpDXIMdFszTgsAo

To claim this, I am signing this object:

@brycedorn
brycedorn / commsec.sublime.snippet
Created August 12, 2015 00:53
a section comment snippet I use
<snippet>
<content><![CDATA[
#~*~*~*~*~*~*----${1/./-/g}----*~*~*~*~*~*~#
# ${1/./ /g} #
# ${1:Section comment block} #
# ${1/./ /g} #
#~*~*~*~*~*~*----${1/./-/g}----*~*~*~*~*~*~#
]]></content>
<tabTrigger>commsec</tabTrigger>
<description>Section Comment</description>
@brycedorn
brycedorn / fips2zips
Created October 25, 2015 19:32
hash converting ZIP to FIPS codes
{"210"=>"33015", "211"=>"33015", "212"=>"33015", "213"=>"33015", "214"=>"33015", "215"=>"33015", "501"=>"36103", "544"=>"36103", "1001"=>"25013", "1002"=>"25015", "1003"=>"25015", "1004"=>"25015", "1005"=>"25027", "1007"=>"25015", "1008"=>"25013", "1009"=>"25013", "1010"=>"25013", "1011"=>"25013", "1012"=>"25015", "1013"=>"25013", "1014"=>"25013", "1020"=>"25013", "1021"=>"25013", "1022"=>"25013", "1026"=>"25015", "1027"=>"25015", "1028"=>"25013", "1029"=>"25003", "1030"=>"25013", "1031"=>"25027", "1032"=>"25015", "1033"=>"25015", "1034"=>"25013", "1035"=>"25015", "1036"=>"25013", "1037"=>"25027", "1038"=>"25015", "1039"=>"25015", "1040"=>"25013", "1041"=>"25013", "1050"=>"25015", "1053"=>"25015", "1054"=>"25011", "1056"=>"25013", "1057"=>"25013", "1059"=>"25015", "1060"=>"25015", "1061"=>"25015", "1062"=>"25015", "1063"=>"25015", "1066"=>"25015", "1068"=>"25027", "1069"=>"25013", "1070"=>"25015", "1071"=>"25013", "1072"=>"25011", "1073"=>"25015", "1074"=>"25027", "1075"=>"25015", "1077"=>"25013", "1079"=>"25
@brycedorn
brycedorn / telnyx_code_challenge.rb
Created July 25, 2016 01:01
A Rails coding assignment that hits an external API and updates Product records based on a JSON payload.
require 'rubygems'
require 'sinatra'
require 'honeybadger'
require 'rest-client'
class App < Sinatra::Base
# Basic POST route to update Product records via a fetch
# to Omega Pricing's API
post '/update_records/' do
start_date = Date.today.prev_month.to_s
curl 'http://api-proxy.chipotle.com/guacsmash/guac-it-out/reg' -H 'Origin: http://www.cado-crusher.chipotle.com' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: */*' -H 'Referer: http://www.cado-crusher.chipotle.com/' -H 'Connection: keep-alive' --data '{"f":"Rick","l":"Sanchez","m":"YOUR-PHONE-NUMBER","s":"true","z":"10065"}' --compressed
@brycedorn
brycedorn / do_us_a_censorship.json
Last active February 22, 2017 22:51
words lays doesn't like
{"words":["69","420","[@a]+n+[a@]+l+","@$$","*damn","*dyke","*fuck*","*F�hrer*","*Fu_k*","*GEN0CIDE*","*nazi*","*niggers","*shit*","2 Girls 1 Cup","3some","3sum","8===D","a$$","abduction","Abort","Aborted","Aborted Fetus","abortion","abuse","abusive","abusive dad","acid","adderall","Adolf","AdolfHitler*","after birth","afterbirth","ahole","AIDS","Alcoholism","amerikkkan","amputate","amputated body parts","amputee","anal","anal beads","anal plug","anal sex","analbeads","analbutt*","analplug","analsex","angel dust","Anis","Anne Frank","anoos","anthrax","anus","anus*","ape shit","apeshit","arse","arse*","ash0le","ash0les","asholes","asininer","ass","_ss","ass-bandit","ass-bandits","ass-clown","ass-face","ass-hat","ass-hole","ass-holes","ass-kiss","ass-kisser","ass-lick","ass-munch","ass-pound","ass-wipe","assbandit","assbandits","Assburger","assclown","asses","assface","assh0le","assh0lez","asshat","asshole","assholes","assholz","asskiss","asskisser","asslick","assmunch","asspound","assrammer","assrape","asss*