This file contains hidden or 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 | |
import sys | |
import logging | |
import datetime | |
def parse_connection(line): | |
tokens = line.split() | |
kind = 'OPEN' if "connection accepted from" in line else 'CLOSE' | |
connection_id = tokens[9] if kind is 'OPEN' \ |
This file contains hidden or 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
(require 'mine-jabber) | |
;; Username & nickname fields from https://banno.hipchat.com/account/xmpp | |
(setq hipchat-username "") | |
(setq hipchat-nickname "") | |
(setq hipchat-password "") | |
(setq hipchat-autojoin-rooms | |
'("aggregation" "assets" "banno_talk" "banno_cms" "data_services" "emacs" "grip" "kernel" "southen" "troll_talk" "webdev" "design_talk")) |
This file contains hidden or 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
:tddium: | |
:java: | |
:java_version: java-6-openjdk | |
:gradle_version: '1.11' | |
:tests: | |
- type: junit | |
mode: parallel | |
prefix: 'Demo' | |
files: | |
- include: 'test/*Test*.java' # Within prefix |
This file contains hidden or 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 matplotlib.pyplot as plt | |
data = {'a': [1, 2, 3], | |
'b': [9, 4, 2], | |
'c': [10, 12, 13]} | |
fig, ax = plt.subplots() | |
for name, value in data.items(): | |
ax.plot(value, label=name) |
This file contains hidden or 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
$ play test | |
[info] Loading project definition from /home/usmcs/workspace/todolist/project | |
[info] Set current project to todolist (in build file:/home/usmcs/workspace/todolist/) | |
[info] ApplicationSpec | |
[info] Application should | |
[info] + send 404 on a bad request | |
[info] + render the index page | |
[info] Total for specification ApplicationSpec | |
[info] Finished in 956 ms | |
[info] 2 examples, 0 failure, 0 error |
This file contains hidden or 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
void redAndGreen() { | |
int redPins[] = {3,5,7,9}; | |
int greenPins[] = {2,4,6,8}; | |
int delayTime = 1000; | |
for (int i=0;i<4;i++) { //turn on red, turn off green | |
digitalWrite(redPins[i], HIGH); | |
digitalWrite(greenPins[i], LOW); | |
} | |
delay(delayTime); |
This file contains hidden or 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
Window not found. The browser window may have been closed. | |
Command duration or timeout: 78 milliseconds | |
Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56' | |
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_31' | |
Session ID: f02673c6-11e6-45c0-8a32-f6dbe927695a | |
Driver info: org.openqa.selenium.firefox.FirefoxDriver | |
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=20.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}] |
This file contains hidden or 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 pymongo import Connection as Cn | |
from itertools import chain as ch | |
collection = λ D, C: Cn()[D][C] | |
orphans = λ c, d, j, k: {[i[j] for i in c]} - {ch(*[a[k] for a in d])} | |
remove = λ d, k, c: map(d[k].remove, c) | |
verify = λ k, t: filter(λ i: k in i[t], c) |
This file contains hidden or 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
#!/bin/bash | |
MAX=$[$2+1] | |
for ((i = $1; i < $MAX; i++)) do | |
#echo "sips -s format pdf \"Scan $i.jpeg\" --out \"Scan$i.pdf\"" | |
sips -s format pdf "Scan $i.jpeg" --out "Scan$i.pdf" | |
done | |
PDFconcat="/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" |
NewerOlder