Skip to content

Instantly share code, notes, and snippets.

View radiosilence's full-sized avatar
🔥

James Cleveland radiosilence

🔥
View GitHub Profile

Title

Here is some text that has rudimentary formatting

<?php $args = array(
'post_type' => 'attachment',
'orderby' => 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'post_status' => null,
'post_parent' => get_the_ID()
);
$attachments = get_posts($args);
$count=0; $i=0;
@radiosilence
radiosilence / gist:1349683
Created November 8, 2011 23:27
Fixed(?) unix v6 memmove
void*
memmove(void *vdst, void *vsrc, int n)
{
char *dst, *src;
dst = vdst;
src = vsrc;
if(*vdst > *vsrc) {
*vdst += n;
*vsrc += n;
4 < Jerub> antihero: the api would eventually look like: def render_GET(self, request): return deferToProcess(convert_image, request.args('imageid')).addCallback(lambda image:
(request.write(image), request.close())); return NOT_DONE_YET
[Background]
Color=0,0,0
Transparency=false
[BackgroundIntense]
Color=20,44,27
Transparency=false
[Color0]
Color=0,0,0
@radiosilence
radiosilence / gnome-terminal-conf.xml
Created June 24, 2011 12:28
Dogs colour scheme for gnome terminal.
<gconfentryfile>
<entrylist base="/apps/gnome-terminal">
<entry>
<key>global/active_encodings</key>
<schema_key>/schemas/apps/gnome-terminal/global/active_encodings</schema_key>
<value>
<list type="string">
<value>
<string>UTF-8</string>
</value>
<?php
$msg = "Lorem";
// Key that user inputs
$okey = "potato";
// A slow hash is made from this key - 2^14 iterations of whirlpool. Salt is generated automatically and is about 100 characters long.
$hash = $hasher->hash($okey);
// Salt of this hash is taken and stored, so that hash can be re-created with correct original key.
$salt = $hasher->pull_salt($hash);
// Last 32 characters of hash are taken for use as actual key
$key = substr($hash, -32);
<pre><?php
class WhirlHasher {
protected $_strength;
protected $_itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
public function __construct($strength=14) {
$this->_strength = $strength;
}
public function hash_password($password, $salt=False) {
@radiosilence
radiosilence / TwilightMod.tmTheme
Created February 3, 2011 16:23
my modifications of the twilight theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Michael Sheets, James Cleveland</string>
<key>name</key>
<string>TwilightMod</string>
<key>settings</key>
<array>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Michael Sheets, James Cleveland</string>
<key>name</key>
<string>TwilightMod</string>
<key>settings</key>
<array>