This Article has struck a chord with me. I'm not an Erlang-er, but the style he describes of "writing many tiny functions" strongly reminds me of why I've come to love Factor.
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
// | |
// This is the result of about an hour's delving into PHP's hairy-ass serialization internals. | |
// PHP provides a session_decode function, however, it's only useful for setting the contents of | |
// $_SESSION. Say, for instance, you want to decode the session strings that PHP stores in its | |
// session files -- session_decode gets you nowhere. | |
// | |
// There are a bunch of nasty little solutions on the manual page[1] that use pretty hairy regular | |
// expressions to get the job done, but I found a simple way to use PHP's unserialize and recurse | |
// through the string extracting all of the serialized bits along the way. | |
// |
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
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
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
-- Size of the board, 40 is nice and fast | |
-- 100 is doable but only runs at 3 fps with current board algorithm | |
-- 10 is fun and good for making sure everything works | |
-- 40 is ideal | |
Size=40 | |
Generation=0 | |
World = { cols=Size, rows=HEIGHT/(WIDTH/Size), last=0.0 } | |
Cell = { size = WIDTH/World.cols, color=color(0, 62, 255, 255) } | |
Directions = { |
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
-- Use this function to perform your initial setup | |
function setup() | |
seed = 1 | |
iparameter("depth", 1, 15) | |
depth = 10 | |
parameter("length", 0, 300) | |
length = 120 | |
parameter("angle", 1, 90) |
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
--- | |
#### | |
#### THIS IS OLD AND OUTDATED | |
#### LIKE, ANSIBLE 1.0 OLD. | |
#### | |
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES | |
#### | |
#### IF IT BREAKS I'M JUST SOME GUY WITH | |
#### A DOG, OK, SORRY | |
#### |
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
USE: peg.ebnf | |
#! throw this in the listener to see the example parse tree | |
"discount_quantity_amount=Discount_Name{repeat|1-5.42|2-5|6-0}" | |
[EBNF | |
number = [0-9]+ => [[ string>number ]] | |
amount = number ("." number)? | |
type = "allunits" | "incremental" | "repeat" | "single" |
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
if status --is-login | |
# Use universal variables to replace globals, this lets set -Ux change PATH and LANG forever | |
set -ge PATH | |
set -gx PATH $PATH | |
set -ge LANG | |
set -gx LANG $LANG | |
function e | |
emacsclient -n $argv |
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 | |
# Usage: python extract_vulns.py <url> | |
# Bog-simple screen scraping, will fail unless URL is something like this: | |
# http://www.ubuntu.com/usn/lucid/ | |
# http://www.ubuntu.com/usn/lucid/?page=3 | |
# | |
from BeautifulSoup import BeautifulSoup | |
import requests, time, sys |
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
<?php | |
class ConfigParser { | |
function __construct($ini_file) { | |
$this->data = parse_ini_file($ini_file, true); | |
if ($this->data === FALSE) { | |
throw new Exception("Error reading file {$ini_file}"); | |
} | |
} | |
function sections() { |