Skip to content

Instantly share code, notes, and snippets.

View MonkeyIsNull's full-sized avatar
:shipit:
Collating

Adam Guyot MonkeyIsNull

:shipit:
Collating
View GitHub Profile
@MonkeyIsNull
MonkeyIsNull / flow.js
Created January 19, 2012 04:04
Serial Flow
// flow in serial
var queue = [
function (msg) {
console.log(msg);
next("second please...");
},
function (msg) {
@MonkeyIsNull
MonkeyIsNull / rsyncwatchd.js
Created January 20, 2012 03:43
An rsync watcher
var fs = require('fs'),
dir = "/tmp/rpki/repository",
tempFile = "/tmp/replace.rsync.conf",
relFile = "/etc/rsyncd.conf",
repo = "[repository]\n\tpath = /tmp/rpki/repository/";
var util = require('util'),
spawn = require('child_process').spawn;
function kick_rsync() {
var _ = require('underscore');
// Example Char for testing
var cel = {
"Upper Strength": 17,
"Lower Strength": 14,
"Structural Stamina": 15,
"Internal Endurance": 19,
"Dexterity": 14,
"Agility": 14,
@MonkeyIsNull
MonkeyIsNull / plop.rb
Created March 22, 2012 00:15
Watches for the Plops of Twitter dropping your friends
require 'rubygems'
require 'twitter'
require 'Getopt/Declare'
class Plop
attr_accessor :who, :seed_file, :peep_list
def initialize(who, seed_file='./plop.seed')
@who = who
@MonkeyIsNull
MonkeyIsNull / file_pw_spit.c
Created May 2, 2012 12:27
Linked List file spitter
// Spits out the lines of a file forwards and backwards, via a linked list
// All Hail Zed Shaw and (Re)Learn C the Hard Way
// This Bitch be free of Memory leaks, Yo!
// ==9234==
// ==9234== HEAP SUMMARY:
// ==9234== in use at exit: 8,280 bytes in 3 blocks
// ==9234== total heap usage: 134 allocs, 131 frees, 14,531 bytes allocated
// ==9234==
// ==9234== LEAK SUMMARY:
// ==9234== definitely lost: 0 bytes in 0 blocks
@MonkeyIsNull
MonkeyIsNull / harn.pl
Created October 1, 2013 00:11
Harn Master Skills setup in Prolog
% str(ulf, 19).
% intell(ulf, 12).
% dex(ulf, 10).
%str(gar, 12).
%intell(gar, 18).
%dex(gar, 13).
% calc_stats(X,N):-
% str(X,Y),
@MonkeyIsNull
MonkeyIsNull / acls.pl
Last active December 28, 2015 22:59
Experimental work on a Vertical and Horizontal Access system
% Here's our set of users
% Mind you, fred has no access_levels, he's a user
% but he can't even logon
user(jon).
user(mary).
user(ed).
user(fred).
% access_level(rankNumber, name, create, read, modify)
@MonkeyIsNull
MonkeyIsNull / urlBuff.go
Created December 24, 2013 02:56
urlBuff simulates downloads with timers. It has four workers that continuously pull from the urlChannel until everything is done
package main
import (
"time"
"math/rand"
"fmt"
"strconv"
)
func randInt(min int, max int) int {
@MonkeyIsNull
MonkeyIsNull / dpdlFiles.go
Last active January 1, 2016 06:59
Download the MP3s from a DropBox server using Channels with 10 workers, handles the nasty redirects
package main
import (
"time"
"fmt"
"io"
"net/http"
"os"
"strings"
"github.com/PuerkitoBio/goquery"
% Monkey problem in Prolog -- Taken from PPAI
% Before reading this code: http://www.youtube.com/watch?v=WnlIWpZSPXU
%
% First up is the move to the final spot we want
move(state(middle, onbox, middle, hasnot), %Before
grasp, %Action
state(middle, onbox, middle, has)). %After -- monkey wins motherfucker!
% Action climb