Skip to content

Instantly share code, notes, and snippets.

View AstraLuma's full-sized avatar
🐍
snek snek snek snek

Jamie Bliss AstraLuma

🐍
snek snek snek snek
View GitHub Profile
@AstraLuma
AstraLuma / ufactor.html
Created July 31, 2011 18:36
Page to continuously factor the timestamp
<!DOCTYPE html>
<html>
<head><title>ufactor</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
function factor(n) {
if (n == 0 || n == 1) return [];
f = 2;
s = Math.sqrt(n);
while (n%f != 0) {
@AstraLuma
AstraLuma / gist:1318930
Created October 27, 2011 06:41 — forked from Steve-V/gist:1318915
seen.old.db
(dp0
S'kellyev'
p1
(S'#thegeekgroup'
p2
F1307326422.069239
tp3
sS'leadhead'
p4
(S'#thegeekgroup'
[user]
name = YOUR NAME HERE
email = your.email@somewhere.com
@AstraLuma
AstraLuma / config.py
Created November 16, 2011 15:36
Config Abstractor
class Config(object):
_sources = []
def __init__(self, sources):
self._sources = []
for s in sources:
if isinstance(s, basestring):
_sources.append(vars(load_file(s))) #TODO: How to load a file?
elif isinstance(s, dict):
_sources.append(s.copy())
else:
@AstraLuma
AstraLuma / thegeekgroup.json
Created November 25, 2011 04:47
Design Doc
{
"_id": "_design/thegeekgroup",
"_rev": "3-0f189bed802f6d23a289c6e4f8064cb3",
"language": "javascript",
"views": {
"active-hours": {
"map": "function(doc){ emit(doc.when[3], 1); }",
"reduce": "function(keys, values){ var s = 0; for (l in values) s += 1; return s; }"
}
}
@AstraLuma
AstraLuma / gist:1392859
Created November 25, 2011 05:18
update_after errors
[Fri, 25 Nov 2011 05:17:38 GMT] [info] [<0.30739.5>] 127.0.0.1 - - 'GET' /tisc/_design/thegeekgroup/_view/active-hours?group=true&stale=update_after 200
[Fri, 25 Nov 2011 05:17:43 GMT] [error] [<0.30759.5>] ** Generic server <0.30759.5> terminating
** Last message in was {'EXIT',<0.30764.5>,
{timeout,
{gen_server,call,
[couch_query_servers,
{get_proc,<<"python">>}]}}}
** When Server state == {group_state,undefined,<<"tisc">>,
{"/var/lib/couchdb/1.1.0",<<"tisc">>,
{group,
@AstraLuma
AstraLuma / cert.pem
Created December 21, 2011 23:39
My PEM files
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
c9:58:e3:01:d4:92:84:47
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Michigan, O=Astro Security, OU=Certificates, CN=Astro Security CA Root
Validity
Not Before: Dec 21 23:08:51 2011 GMT
Not After : Dec 20 23:08:51 2012 GMT
@AstraLuma
AstraLuma / .bashrc
Created December 26, 2011 01:00
My .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
@AstraLuma
AstraLuma / ssltest.js
Created February 19, 2012 18:33
HTTPS Test Server
#!/usr/bin/env node
const fs = require("fs"),
https = require("https");
var opts = {
key: fs.readFileSync("myprivatekey.pem", 'utf8'),
cert: fs.readFileSync("mypublickey.pem", 'utf8'),
ca: [fs.readFileSync("ca-pub.pem", 'utf8')],
requestCert: true,
@AstraLuma
AstraLuma / uinput.py
Created May 4, 2012 16:07
Results of SWIG
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname