Skip to content

Instantly share code, notes, and snippets.

View ELLIOTTCABLE's full-sized avatar
🐫

ELLIOTTCABLE

🐫
View GitHub Profile
@ELLIOTTCABLE
ELLIOTTCABLE / gist:5216473
Created March 21, 2013 20:33
git.io breaking on slugs with slashes in them
> curl -i http://git.io -F "url=https://github.com/elliottcable/Paws.js" -F "code=ec/paws.js"
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
Server: GitHub.com
X-Node: gitio2
Content-Type: text/html;charset=utf-8
Date: Thu, 21 Mar 2013 20:28:32 GMT
Status: 201 Created
X-Revision: bf8bd90875382da4fa2b4842c02b54404c2f3220
# Their xor_encrypt, modified to take a key
function xor_encrypt($text, $key) {
$outText = '';
// Iterate through each character
for($i=0;$i<strlen($text);$i++) {
$outText .= $text[$i] ^ $key[$i % strlen($key)];
}
return $outText;
@ELLIOTTCABLE
ELLIOTTCABLE / love.coffee
Last active December 14, 2015 20:48
Tell her so. (= #AppleScript #nodejs #JavaScript #MacOSX #iMessage
cp = require 'child_process'
handle = '[email protected]'
message = 'I love you.'
interval = 15
love = ->
osascript = cp.spawn 'osascript', [], {stdio: ['pipe', 1, 2]}
console.log '-- Spawning `osascript`'
osascript.stdin.write """
# ‘alternate_git’:
# > GIT_ALTERNATE_OBJECT_DIRECTORIES=../other_repo/.git/objects \
# git cherry-pick $(git --git-dir=../other_repo/.git rev-parse --verify e9721)
# ... becomes ...
# > agit ~[../other_repo] cherry-pick ~[e9721]
#
# This is some seriously evil, hacky shit; but it works, unlike my original attempt with subshells.
# (Damn you, subshells.)
function agit() {
env GIT_ALTERNATE_OBJECT_DIRECTORIES="$1/.git/objects" \
@ELLIOTTCABLE
ELLIOTTCABLE / gist:5051464
Created February 27, 2013 20:35
Output of `rvm --trace upgrade 1.9.3-p327 1.9.3-p392` on my OS X 10.8
+__rvm_parse_args:681> [[ -n 5.0.0 ]]
+__rvm_parse_args:716> [[ -z '' && -n '' ]]
+__rvm_parse_args:719> [[ error == || 0 -eq 1 || -n '' ]]
+__rvm_parse_args:16> [[ -n upgrade ]]
+__rvm_parse_args:18> rvm_token=upgrade
+__rvm_parse_args:20> (( 2 > 0 ))
+__rvm_parse_args:22> next_token=1.9.3-p327
+__rvm_parse_args:23> shift
+__rvm_parse_args:28> case upgrade ([[:alnum:]]*|@*)
+__rvm_parse_args:31> case upgrade (use)
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
</head>
<body>
<div id="mocha"></div>
<!-- <script src="jquery.js"></script> -->
<script src="../node_modules/expect.js/expect.js"></script>
<notelliottcable> Getting rid of executions, as they currently exist.
<notelliottcable> reneging on a bunch of my old set-ways:
<notelliottcable> - mutable code-type (this is crucial),
<notelliottcable> - code-type as a direct ordered-list of juxtapositions, as the |…| syntax we've occasionally used to describe them
<notelliottcable> - code now *continues* instead of *advancing* (i.e. ‘executions’ replaced by traditional ‘continuations’)
<notelliottcable> all of which are things various of you have asked for in the past
<notelliottcable> So, here's a sketch:
<notelliottcable> Script type, a lá olden days; Script being a list-of-Jux's, annotated and sprinkled by ‘process’ operations
<notelliottcable> Jux type, holding *either* A) a juxtaposee-value (right-hand-side), or B) a result-value
<notelliottcable> (with the possibility of holding an *empty* result-value, and no juxtaposed-value, and thus representing a predefined “hole”, as Micah calls them)
> python googlevoice_read_all.py
2160
Traceback (most recent call last):
File "googlevoice_read_all.py", line 11, in <module>
for message in folder.messages:
File "/usr/local/lib/python2.7/site-packages/googlevoice/util.py", line 242, in messages
return [Message(self, *i) for i in self['messages'].items()]
File "/usr/local/lib/python2.7/site-packages/googlevoice/util.py", line 181, in __init__
assert is_sha1(id), 'Message id not a SHA1 hash'
AssertionError: Message id not a SHA1 hash
@ELLIOTTCABLE
ELLIOTTCABLE / some.paws
Created January 1, 2013 01:25
Trying to add a FUNC to locals. ಠ_ಠ
implementation void()
( infrastructure execution stage()
(infrastructure affix() (locals))
(infrastructure empty()) )
( infrastructure execution stage()
(infrastructure charge() (locals))
(infrastructure length() (locals)) )
@ELLIOTTCABLE
ELLIOTTCABLE / index.fml
Created December 30, 2012 22:19
My ancient landing page, re-written in “FML.”
html
(xmlns http://www.w3.org/1999/xhtml
xml:lang en)
head
title elliottcable
link(rel copyright
, href http://creativecommons.org/licenses/by-nc-sa/3.0/, type text/html;charset=utf-8)
link(, rel openid.server, href http://www.myopenid.com/server)
link(, rel openid.delegate, href http://elliott.cable.myopenid.com/)