Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View frewsxcv's full-sized avatar
🇵🇸

Corey Farwell frewsxcv

🇵🇸
View GitHub Profile
import subprocess
import time
import difflib
import sys
import os
from string import rstrip
def run(command, infile_path, timeout=10):
/* Original */
var setIcon = function (evt) {
var base = "http://incidents.slocountyfire.org/static/img/";
if (evt.properties.category === "Medical") {
evt.layer.options.icon = new L.Icon(base + "m-marker.png");
} else if (evt.properties.category === "Fire") {
evt.layer.options.icon = new L.Icon(base + "f-marker.png");
} else if (evt.properties.category === "Hazard") {
evt.layer.options.icon = new L.Icon(base + "h-marker.png");
@frewsxcv
frewsxcv / gist:3717440
Created September 13, 2012 20:36
status
Status = (function() {
function Status() {
this.$status = $('#status');
}
Status.prototype.set = function(str) {
var _this = this;
this.$status.text(str);
if (this.timeoutID) {
@frewsxcv
frewsxcv / gist:3825258
Created October 3, 2012 05:45 — forked from MLLeKander/gist:3825222
305 BoardTest Shell
#!/usr/bin/python
from sys import argv, stdin, stdout
import re
translate = {
'em': 'enterMove',
'sm': 'showMove',
'show': 'showBoard',
'am': 'applyMove',
'dm': 'doMove',
#!/usr/bin/python2
import os
import mutagen
def getinfo(song):
artist = "Unknown"
if song.has_key("ALBUMARTIST"):
artist = song.get("ALBUMARTIST").pop()
import lxml.html
def get_incidents():
incidents = []
url = "http://slonews.thetribunenews.com/police_log/slo_log.php"
tree = lxml.html.parse(url)
for inc in tree.xpath("//table[@class='report']"):
inc_keys = inc.xpath("tr/td[@class='c1']")
inc_keys = [key.text_content() for key in inc_keys]
@frewsxcv
frewsxcv / README.md
Created December 6, 2012 23:42 — forked from mbostock/.block
Stacked Area Chart

This stacked area chart is constructed from a TSV file storing the market share of several popular web browsers over the last year. Data is from Clicky Web Analytics. The chart employs conventional margins and a number of D3 features:

function LetterCountI(str) {
str = str.split(" ");
var answer = "";
var mostRep = 1;
for (i = 0; i < str.length; i++)
if (eachWord(str[i]) > mostRep) {
mostRep = eachWord(str[i]);
answer = str[i];
}
if (mostRep === 1)
import itertools
import time
def finish_off(cards, deck1, deck2):
while len(deck1) != 0 and len(deck2) != 0:
try:
cards.insert(0, deck1.pop())
cards.insert(0, deck2.pop())
except IndexError:
pass
void XmppSipPlugin::onPresenceReceived(const Ptr&, const Jreen::Presence&) * New presence: "randyychan@gmail.com/android_talk45ee213fa697" 10
void XmppSipPlugin::onPresenceReceived(const Ptr&, const Jreen::Presence&) "randyychan@gmail.com/android_talk45ee213fa697" Running tomahawk: maybe caps "http://www.android.com/gtalk/client/caps" requesting disco...
Jreen:Debug:send iq to "randyychan@gmail.com/android_talk45ee213fa697" from ""
Jreen:Debug:send iq to "randyychan@gmail.com" from ""
Servent::SocketError: QAbstractSocket::SocketTimeoutError "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" "liam.carter.condon@gmail.com/tomahawk77E6FB4566"
Connection "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" FAILED *************** QThread(0x1fcfa20)
void Connection::shutdown(bool) false "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26"
void Connection::actualShutdown() false "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26"
DTOR controlconnection
DTOR connection (super) "7b6c0e5e-4e58-4dc7-a1dd-4e9cfd01cf26" QThread(0x1fcfa20) true