This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; js-beautify.el -- beautify some js code | |
(defgroup js-beautify nil | |
"Use jsbeautify to beautify some js" | |
:group 'editing) | |
(defcustom js-beautify-args "--jslint-happy --brace-style=end-expand --keep-array-indentation" | |
"Arguments to pass to jsbeautify script" | |
:type '(string) | |
:group 'js-beautify) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# an rpn calculator in python | |
# > 19 2.14 + 4.5 2 4.3 / - * | |
# [85.297441860465113] | |
# only supports two operands and then an operator | |
import operator | |
ops = { '+': operator.add, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
# called via `panagram.py ktocail` | |
# last letter in the word is required | |
def get_words(letters): | |
# prevent dupes | |
seen = set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// blame_comma.js -- loop through the files passed in and see who has commas | |
// in them | |
// find ../htdocs/js/ECM -type f -name "*.js" -print | xargs java -classpath /usr/share/yuicompressor-2.4.2/lib/rhino-1.6R7.jar org.mozilla.javascript.tools.shell.Main blame_comma.js | |
load('fulljslint.js'); | |
load('runtime.js'); | |
(function(args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import cStringIO | |
import codecs | |
import csv | |
import logging | |
import sys | |
import webbrowser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# send github starred repos to pinboard | |
# Get the token here: | |
# https://api.pinboard.in/v1/user/api_token/info | |
from __future__ import print_function | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Grab the books from the current year from goodreads and emit an org mode table. | |
""" | |
from __future__ import print_function | |
import datetime | |
from email.utils import parsedate | |
import sys | |
import time | |
from xml.dom import minidom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import objectify | |
tree = objectify.parse('/home/seth/Downloads/slackorama-2018-01-17-pettit-1-9725148.tcx') | |
root = tree.getroot() | |
namespaces = {'ns': 'http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2', | |
'ns3': 'http://www.garmin.com/xmlschemas/ActivityExtension/v2'} | |
for tp in root.xpath('//ns:Trackpoint', namespaces=namespaces): | |
print(tp.Time); | |
print(tp.xpath('.//ns:Extensions/ns3:TPX/ns3:Watts', namespaces=namespaces)[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rtm | |
token = '' # get this somewhere else | |
# this is the token and secret from the rtm-cli app so I assume putting it here is ok | |
milk = rtm.createRTM('cbc76268b901ccb8d9fc5f3aebc4ee1f', | |
'131beea786379309', | |
token | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import time | |
import requests | |
SLEEP_TIME = 5 |
NewerOlder