Skip to content

Instantly share code, notes, and snippets.

View nevali's full-sized avatar
🏳️‍🌈
Always, always busy

Mo McRoberts nevali

🏳️‍🌈
Always, always busy
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>diskUuid</key>
<string>%4vj34C%TL244fUBHccbKg</string>
</dict>
</plist>
@nevali
nevali / terminal-settings.sh
Created December 9, 2012 21:55
Command-line script to adjust a Mac OS X Terminal.app's settings set
#! /bin/sh
if test x"$1" = x"" ; then
echo "Usage: $0 SETTINGS-SET" >&2
exit 1
fi
settings="$1"
tty=`tty 2>/dev/null`
if test x"$tty" = x"" || test x"$tty" = x"not a tty" ; then
@nevali
nevali / gist:3331762
Created August 12, 2012 13:11
Y/Cb/Cr colour values (BT.709)
Name Y % Cb % Cr % 8-bit 10-bit 16-bit
---------------------------------------------------------------------------
black 0.00% 50.20% 50.20% 10/80/80 040/200/200 1000/8000/8000
white 100.00% 50.20% 50.21% eb/80/80 3ac/200/200 eb00/8000/8006
red100 22.15% 38.75% 100.00% 41/67/f0 102/19a/3c0 4082/665a/f000
green100 71.54% 11.65% 4.64% ad/2a/1a 2b2/0a7/068 acac/29a6/19f2
blue100 7.21% 100.00% 45.61% 20/f0/76 07f/3c0/1d7 1fca/f000/75b8
cyan100 78.75% 61.65% 0.05% bc/9a/10 2f1/266/040 bc76/99a6/1000
magenta100 29.36% 88.75% 95.77% 50/d7/e7 141/359/398 504c/d65a/e613
yellow100 93.69% 0.20% 54.80% dd/10/8b 374/040/229 dd2e/1000/8a4e
#! /bin/sh
if `mount | grep " on /opt/cache" >/dev/null` ; then
echo "$0: Already mounted" >&2
exit 0
fi
SIZE=582715
if ! disk=`hdiutil attach -nomount ram://$SIZE` ; then
exit 1
@nevali
nevali / NOTES
Created August 19, 2011 22:16
NSThread+Suspendable
This should probably use a condition instead of the resume mutex alone — that way, it can sit on a pthread_cond_wait() or equivalent instead of sleeping. It might possibly be worth doing the same with the suspended mutex.
{
"http://schema.org/Thing":{
"http://schema.org/Event":{
"http://schema.org/EducationEvent":1,
"http://schema.org/UserInteraction":{
"http://schema.org/UserLikes":1,
"http://schema.org/UserCheckins":1,
"http://schema.org/UserPlusOnes":1,
"http://schema.org/UserTweets":1,
"http://schema.org/UserBlocks":1,
#! /bin/sh
emacsdir=/Local/Applications/Emacs.app
PATH=${emacsdir}/Contents/MacOS/bin:$PATH
export PATH
sock="$TMPDIR/emacs$UID/server"
if test x"$TERM_PROGRAM" = x"Apple_Terminal" || test x"$TERM_PROGRAM" = x"iTerm.app" ; then
HEAD /foo HTTP/1.1
Host: example.com
Accept: application/rdf+xml, text/turtle, text/html, */*
HTTP/1.1 200 OK
Content-type: application/rdf+xml
Content-location: /foo.rdf
Alternates: {"/foo.rdf" 1.0 {type application/rdf+xml}}, {"/foo.ttl" 1.0 {type text/turtle}}, {"/foo.html" 0.8 {type text/html}}
Vary: negotiate
@nevali
nevali / rdf-canon-test.xml
Created April 26, 2011 12:43
RDF canonicalisation test
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://example.com/ns#">
<!-- _:a <eg:x> _:b . _:b <eg:x> _:a . _:c <eg:x> _:b .
_:a <eg:x> _:c . _:b <eg:x> _:c . _:c <eg:x> _:a . -->
<rdf:Description rdf:ID="b">
<ex:x rdf:resource="#a" />
<ex:x rdf:resource="#c" />
</rdf:Description>
@nevali
nevali / gist:879608
Created March 21, 2011 15:19
RadioDNS lookup for BBC Prototyping’s test RadioVIS server
$ ./radiodns -domain -target -verbose fm 9790 0xc201 ce1 prototype0.net
Domain: 09790.c201.ce1.fm.prototype0.net
Target: kw.bbc.co.uk
$ ./radiodns -app radiovis fm 9790 0xc201 ce1 prototype0.net
Instance (no name):
1 service record:
IN SRV 0 100 61613 radiodns.prototype0.net.
No parameters.