Skip to content

Instantly share code, notes, and snippets.

View banterability's full-sized avatar

Jeff Long banterability

View GitHub Profile
@banterability
banterability / us.json
Created January 25, 2023 19:54
states
[
{ "code": "SC", "name": "South Carolina" },
{ "code": "AL", "name": "Alabama" },
{ "code": "NE", "name": "Nebraska" },
{ "code": "WV", "name": "West Virginia" },
{ "code": "ID", "name": "Idaho" },
{ "code": "MO", "name": "Missouri" },
{ "code": "AK", "name": "Alaska" },
{ "code": "UT", "name": "Utah" },
{ "code": "IA", "name": "Iowa" },
"Arkansas",
"Washington, D.C.",
"Delaware",
"Florida",
"Georgia",
"Kansas",
"Louisiana",
"Maryland",
"Missouri",
"Mississippi",
function flashSupported(){
if (window.ActiveXObject){
try {
new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
return true;
} catch (e) {
return false;
}
} else {
return Array.from(navigator.plugins).some(function(plugin){
@banterability
banterability / gist:0ac52fdde9deb9c41282
Last active August 29, 2015 14:13
A terrible js loop to run in console to delete all your tweets
// Run from twitter.com/<yourusername>
// this will (duh) delete all your tweets. don't be dumb.
var deleteLoop;
deleteLoop = setInterval(function(){
var deleteButton = $('.js-actionDelete button');
if(deleteButton.length < 1){
clearInterval(deleteLoop);
alert('No more things to delete');
} else {
deleteButton[0].click();

Keybase proof

I hereby claim:

  • I am banterability on github.
  • I am banterability (https://keybase.io/banterability) on keybase.
  • I have a public key whose fingerprint is E5D9 0808 D4C9 EAD6 6749 DADD 1E96 B62F D7C6 52F4

To claim this, I am signing this object:

@banterability
banterability / battery.coffee
Last active January 14, 2016 00:37
Get iPhone battery life over time from Reporter App's (http://www.reporter-app.com/) logs in Dropbox
async = require 'async'
fs = require 'fs'
{filter, flatten} = require 'underscore'
OBJ_C_EPOCH = 978307200
DROPBOX_DIR = #"<path to your dropbox folder >/Dropbox/Apps/Reporter-App/"
fs.readdir DROPBOX_DIR, (err, files) ->
throw new err if err?
dataFiles = filter files, (filename) -> /.json/.test filename
@banterability
banterability / ctaIcons.js
Created August 14, 2013 23:16
Generate images from groups of CTA L lines and generate data URLs for use as iOS home screen icons.
var ctaColors = {
blue: '#00A1DE',
brown: '#62361B',
green: '#009B3A',
orange: '#F9461C',
pink: '#E27EA6',
purple: '#522398',
red: '#C60C30',
yellow: '#F9E300'
}
<script src="http://media.scpr.org/assets/scripts/webtrends.v2.js"></script>
<script>
//<![CDATA[
var _tag=new WebTrends();
_tag.dcsGetId();
//]]>
</script>
<script>
//<![CDATA[
_tag.dcsCustom=function(){
@banterability
banterability / code2doc.coffee
Created January 11, 2011 21:03
Bookmarklet to switch between GitHub code & documentation in GitHub pages
h = location.href
docStr = /^http:\/\/(\w*).github.com\/(\w*)(?:\/.*)?/
codeStr = /^https?:\/\/github.com\/(\w*)\/(\w*)(?:\/.*)?/
docTmp = "http://$user.github.com/$proj"
codeTmp = "https://github.com/$user/$proj"
isDoc = h.match(docStr)
isCode = h.match(codeStr)
redirect = (loc) ->
@banterability
banterability / score.py
Created December 1, 2010 23:25
Time-based ranking algorithm influenced by Hacker News
# based on http://amix.dk/blog/post/19574
from datetime import datetime, timedelta
GRAVITY = 0.5 # HN default: 1.8
WINDOW = 36 # max age in hours
now = datetime.now()
def hours_from_dt(dt):