Skip to content

Instantly share code, notes, and snippets.

View virtadpt's full-sized avatar
💭
First thing that Microsoft does when buying Github: Add statuses. Whee.

The Doctor virtadpt

💭
First thing that Microsoft does when buying Github: Add statuses. Whee.
View GitHub Profile
@virtadpt
virtadpt / README.md
Created February 16, 2012 17:10 — forked from thedod/README.md
Demagnetizr - Tweetable magnet urls
@virtadpt
virtadpt / gist:3230577
Created August 1, 2012 20:47 — forked from loki42/gist:2349796
multilingual python web app with babel
# get all langs from db
all_available_languages = [a['lang'] for a in cur.fetchall()]
def get_lang(lang):
default = 'en'
mo_dir = os.path.join(os.path.abspath(os.curdir), 'locale')
domain = 'musicfilmcomedy'
langs = [lang.replace('-', '_')]
langs.append(default)
@virtadpt
virtadpt / rhi-mesh-01.md
Created November 13, 2012 23:27 — forked from boxysean/rhi-mesh-01.md
Red Hook Initiative mesh update: first edition

This is the first of periodic updates I'll make as I gather information.

About

Internet connectivity is largely out in Red Hook. (Open question: How out?) A collection of initiatives are working together to rapidly build infrastructure to provide free, reliable Internet connectivity to Red Hook.

The goal of this project is twofold: to provide Internet connectivity in the short-term for the disaster relief effort, and to create an infrastructure for future disaster responses.

Groups involved:

@virtadpt
virtadpt / gist:5157510
Created March 13, 2013 23:34
This is a copy of the CodeMirror Unhosted text editor (https://unhosted.org/adventures/2/An-unhosted-editor.html), which I've set aside for an article about unhosted web applications. I've copied it into a Gist so that people who are curious can poke around in the code. Please note that the code is serialized into a single line (a URL, actually)…
data:text/html;charset=utf-8,<!DOCTYPE html lang%3D"en">%0A<html>%0A <head>%0A <meta charset%3D"utf-8">%0A <title>codemirror<%2Ftitle>%0A %0A %0A %0A <!-- http%3A%2F%2Fcodemirror.net%2Flib%2Fcodemirror.js --><script>%0A%2F%2F CodeMirror version 2.34%0A%0A%2F%2F All functions that need access to the editor's state live inside%0A%2F%2F the CodeMirror function. Below that%2C at the bottom of the file%2C%0A%2F%2F some utilities are defined.%0A%0A%2F%2F CodeMirror is the only global var we claim%0Awindow.CodeMirror %3D (function() {%0A "use strict"%3B%0A %2F%2F This is the function that produces an editor instance. Its%0A %2F%2F closure is used to store the editor state.%0A function CodeMirror(place%2C givenOptions) {%0A %2F%2F Determine effective options based on given values and defaults.%0A var options %3D {}%2C defaults %3D CodeMirror.defaults%3B%0A for (var opt in defaults)%0A if (defaults.hasOwnProperty(opt))%0A options[opt] %3D (givenOptions %26%26 givenOptions.ha
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@virtadpt
virtadpt / gist:9653278
Created March 19, 2014 22:59
keybase.md
### Keybase proof
I hereby claim:
* I am virtadpt on github.
* I am drwho (https://keybase.io/drwho) on keybase.
* I have a public key whose fingerprint is 7960 1CDC 85C9 0B63 8D9F DD89 3BD8 FF2B 807B 17C1
To claim this, I am signing this object:
@virtadpt
virtadpt / Ironmonger
Created July 8, 2014 17:16
Huginn Agent Scenario: Ironmonger
{
"name": "Ironmonger",
"description": "Ironmonger is a network of agents which watches the stock prices of the 20 biggest defense contractors in the United States and alerts if their stock prices jump by more than three (3) standard deviations, meaning that one or more has just won a big contract and something's coming. Send an e-mail if something happens.",
"source_url": false,
"guid": "88f6cd314e66146e2314b6860c9e91d5",
"exported_at": "2014-07-08T17:15:18Z",
"agents": [
{
"type": "Agents::PeakDetectorAgent",
"name": "Ironmonger - Watch for rapid stock price changes",
@virtadpt
virtadpt / browser.py
Last active August 29, 2015 14:06 — forked from tdfischer/browser.py
#!/usr/bin/env python
from PyQt4 import QtCore, QtWebKit, QtGui, QtDeclarative
import sys
import random
app = QtGui.QApplication(sys.argv)
view = QtDeclarative.QDeclarativeView(QtCore.QUrl("browser.qml"))
view.show()
@virtadpt
virtadpt / gist:690d420ce5f1a35841d4
Created September 30, 2014 18:18
Exocortex: Ironmonger
{
"name": "Ironmonger",
"description": "Ironmonger is a network of agents which watches the stock prices of the 20 biggest defense contractors in the United States and alerts if their stock prices jump by more than three (3) standard deviations, meaning that one or more has just won a big contract and something's coming. Send an e-mail if something happens.",
"source_url": false,
"guid": "88f6cd314e66146e2314b6860c9e91d5",
"tag_fg_color": null,
"tag_bg_color": null,
"exported_at": "2014-09-30T18:16:54Z",
"agents": [
{
@virtadpt
virtadpt / gist:a6fc2eedbb684b551876f5bb4a5b717e
Created April 3, 2016 23:32
How I integrated Medium with Huginn.
RssAgent:
{
"expected_update_period_in_days": "365",
"clean": "false",
"url": "http://drwho.virtadpt.net/rss/feed.xml"
}
ChangeDetectorAgent:
{
"property": "{{last_updated}}",