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 / input.xml
Created May 14, 2012 21:20
My Templating Format
<?xml version="1.1" ?>
<?js
var foo;
console.log("Hello");
?>
<js:root xmlns:js="http://astro73.com/xml/grue/js">
<foo js:if="bar">
Hi.
@AstraLuma
AstraLuma / config.yml
Created February 12, 2013 05:32
The config file for giant caves. Place in <tekkit server>/plugins/GiantCaves
worlds:
- name : underworld # The name of a world to apply giant caves
sxz : 200 # Horizontal stretch (larger number = wider cave)
sy : 100 # Vertical stretch (larger number = taller cave)
cutoff : 62 # Minimum Perlin density cutoff (-100 to 100)
miny : 6 # Lower bound of cave zone
maxy : 250 # Uppoer bound of cave zone
debug : false # Turns on invert mode for experimenting with config values (true/false)
def __getattr__(self, name):
return lambda *p, **kw: self.callapi(name, *p, **kw)
def callapi(self, name, *p, **kw):
if 'context' in kw:
context = kw['context']
del kw['context']
else:
context = self.getContext()
# ... call modules
diff --git a/includes/functions_posting.php b/includes/functions_posting.php
index a94364e..b848faa 100644
--- a/includes/functions_posting.php
+++ b/includes/functions_posting.php
@@ -1179,6 +1179,19 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
trigger_error('NO_MODE');
}
+ // IRC Notifications
+ include_once($phpbb_root_path . 'ircnotify/notify.php');
@AstraLuma
AstraLuma / gist:5970631
Created July 10, 2013 21:49
A basic spider to aggregate statuses
#!/usr/bin/python -i
import argparse
import collections
import Queue
import logging
import requests
import threading
import urlparse
from bs4 import BeautifulSoup
@AstraLuma
AstraLuma / simon.ino
Last active December 20, 2015 01:39
typedef, void functions, and other issues.
#define SHOW_LENGTH 350 // How long to show each color
#define WAIT_LENGTH 1000 // How long to wait for the user to tap each one
#define TIME_FOR_TURN(t) 500 // Time for each correct turn
#define WINNER_BONUS (15*1000) // Time for winning the game
/*
RXLED
PB3:6 Buttons
PD0:2 Center Input selector
TXO Radio Transmit(?)
PD4 Color Button Select
#!/bin/sh
sudo modprobe v4l2loopback
# This works just fine, w/o sound
#gst-launch-0.10 filesrc location=$1 ! decodebin ! v4l2sink device=/dev/video0
# This fails to play
gst-launch-0.10 filesrc location=$1 ! decodebin name=decoder \
decoder. ! audioconvert ! alsasink \
decoder. ! videoconvert ! v4l2sink device=/dev/video0 \
@AstraLuma
AstraLuma / map.py
Created January 7, 2014 20:22
A proposed map/reduce definition I have in my head
from __args__ import doc
if docs['score'] > 50:
yield None, {'player_name': doc['name']}
@AstraLuma
AstraLuma / generated.py
Created January 7, 2014 21:17
This is an idea for a method of defining function bodies inside of eg: JSON properties, special files, or other methods. Inspired by a dislike of existing CouchDB query servers for python. Implemented as an ast post-processor.
import os
import sys
# Approximate
def _generated_function_name(**__args__):
spam = __args__['spam']
eggs = __args__['eggs']
del __args__
return os.path.exists(os.path.join(spam, eggs))
@AstraLuma
AstraLuma / local.ini
Created January 20, 2014 19:42
Additions to my CouchDB configuration
[httpd_global_handlers]
_example = {couch_httpd_proxy, handle_proxy_req, <<"http://example.com">>}
[httpd_db_handlers]
_example = {couch_httpd_proxy, handle_proxy_req, <<"http://example.com">>}
[httpd_design_handlers]
_example = {couch_httpd_proxy, handle_proxy_req, <<"http://example.com">>}