Skip to content

Instantly share code, notes, and snippets.

@foogoof
foogoof / try all viable ow algorithms.sh
Created August 2, 2016 23:06
try all viable ow algorithms
#!/usr/bin/env bash
# depends on a file named full.bin containing the base64 decoded contents of the message
# yes this is a mess, sorry I'm in a rush
CIPHERS="bf-cfb
bf-ofb
cast5-cfb
cast5-ofb
des-cfb
#!/bin/env bash
# depends on a file named full.bin containing the base64 decoded contents of the message
# yes this is a mess, sorry I'm in a rush
CIPHERS="aes-128-cbc
aes-128-ecb
aes-192-cbc
aes-192-ecb
aes-256-cbc
@foogoof
foogoof / super-shake.cljs
Created September 13, 2012 00:35
Shakes a DOM element
(defn super-shake [item value]
(start (apply bind item (mapcat (fn [dist] [{:effect :slide, :left dist, :time 375}
{:effect :slide, :left (- dist), :time 375}])
(range 500 0 -100)))))
@foogoof
foogoof / o hai wtf.lol
Created May 27, 2011 20:29
yet another hello world
BTW DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
BTW Version 2, December 2004
BTW
BTW Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
BTW
BTW Everyone is permitted to copy and distribute verbatim or modified
BTW copies of this license document, and changing it is allowed as long
BTW as the name is changed.
BTW
BTW DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@foogoof
foogoof / layout.html
Created May 18, 2011 12:38
goes with gist 978486
<html>
<head><title>Hola!</title>
<script src="/javascripts/prototype.js"></script>
</head>
<body>
<%- body %>
<pre>
<div id="mid"></div>
</pre>
<div id="fin"><br/><br/></div>
@foogoof
foogoof / webtail.js
Created May 18, 2011 12:29
Express / node / socket.io code to stream unix child process output over websockets
//
// Just skip to the bottom
//
var express = require('express');
var io = require('socket.io');
var app = module.exports = express.createServer();
// Configuration
@foogoof
foogoof / index.html
Created May 18, 2011 12:28
html page to tail system.log over websockets
<script src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
var socket = new io.Socket();
socket.connect();
socket.on('connect',
function(){
console.log('connected');
socket.send('/var/log/system.log');
});
@foogoof
foogoof / recall_this_callback.js
Created May 8, 2011 21:55
trying to verify a sequence of messages in one vows.js test
// vows calls transmute, which registers trap as the listener to all specified events
// node sends each message to the trap() callback
// FAIL: trap calls this.callback with its arguments
// PASS: trap calls this.callback with a property which cached arguments from each invocation of trap
// HOWTO pass / fail: toggle the conditional at line 152
// revised sample output:
//
// PASS
//
@foogoof
foogoof / vows_unit_tests_for_ansi_code.js
Created May 2, 2011 12:30
test code from ansi control character code
var batch_util = {
'utility functions': {
'starts_sequence' : {
'can detect a simple sequence': function() {
assert.ok(ansi.util.starts_sequence('\u001b[foobar'));
},
'rejects something obviously not a sequence': function() {
assert.ok(!ansi.util.starts_sequence('foobar'));
},
'rejects a truncated sequence': function() {
@foogoof
foogoof / gist:950930
Created May 1, 2011 22:13
world, hello in node.js
function hello_world () {
setTimeout(function() {
console.log("world");
}, 5000);
console.log("hello");
}
hello_world();