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
/* PeopleView hacks */
html#ctl00_htmlMaster>body.orgchart td.listingTableOptions>table {
width: 100%;
outline: solid red 1px;
}
html#ctl00_htmlMaster>body.orgchart td.scrollingTD {
width: auto !important;
}
@nevali
nevali / gist:10685573
Created April 14, 2014 21:57
Prototyping liblod
### This is a transcript of lod-util, a test harness for `liblod`, which I sat and wrote this
### evening: in effect, it wraps up libcurl and librdf in order to provide a sensible context-based
### approach to consuming Linked Data. It has one core API call: lod_resolve(), which is passed a
### a context, a LOD URI string and a fetch mode parameter. The fetch mode is 'always',
### 'only if absent', or 'never'. Each time a URI is resolved, the triples that are parsed are
### added to the context's model.
###
### The fetch mode for lod-util is 'only if absent', which means that if there are already triples
### about the subject in the model, a new request won't be made. You can see below that after parsing
### Henry Story's FOAF file, information is already known about Dan Brickley. Executing the command
@nevali
nevali / gist:10753613
Created April 15, 2014 18:03
liblod continued: now follows redirects properly; parses HTML to find <link rel="alternate"> elements linking to supported RDF serialisations; the test harness now has the ability to quickly locate and dump the primary topic of the most recently-received document (assuming the document is itself described in the RDF returned); and cURL calls are…
$ ./lod-util
./lod-util: a test harness for liblod
Enter a URI to resolve, or .COMMAND (type '.help' for a list of commands)
> .help
Available commands:
.help Print this message
.quit or .exit End lod-util session
.reset Discard the current context
@nevali
nevali / gist:10786827
Created April 15, 2014 23:04
liblod, part 3: an agent can now opt to follow foaf:primaryTopic; and redirects are dealt with much more sensibly—the redirect URL (if status was not a 303) is pushed into a FIFO list of subjects, and subject matching will be attempted in each in turn. in other words, redirects work as you would expect.
$ ./lod-util
./lod-util: a test harness for liblod
Enter a URI to resolve, or .COMMAND (type '.help' for a list of commands)
> .follow
will follow foaf:primaryTopic
> http://bbc.co.uk/spooks
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dct: <http://purl.org/dc/terms/> .

Keybase proof

I hereby claim:

  • I am nevali on github.
  • I am nevali (https://keybase.io/nevali) on keybase.
  • I have a public key whose fingerprint is 0AD2 8B2D 2196 76C7 3BE6 32F7 E751 1334 CEBC F03E

To claim this, I am signing this object:

@nevali
nevali / 64-bit-wtf.c
Created May 22, 2009 15:31
int64_to_base36
char *
int64_to_base36(uint32_t src, char *buf)
{
const char base36[] = "0123456789abcdefghijklmnopqrstuvwxyz";
int c;
c = 0;
while(src)
{
fprintf(stderr, "%02d: src = 0x%016x (%llu), r = %d\n", c, src, src, src % 36);
@nevali
nevali / dbcore.php
Created June 28, 2009 11:26
Early version of Eregansu’s DBCore
<?php
/* Copyright 2009 Mo McRoberts.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@nevali
nevali / uploadResizeCrop.php
Created July 16, 2009 13:10
Quick image resizing script
<?php
ini_set("memory_limit", "128M");
$target_path = 'full/';
$thumb_path = 'thumbs/';
$formats = array('jpg', 'gif', 'png');
/* Grab the extension of the uploaded file, and sanitise the rest of the
1. Reboot
2. Hold down Cmd + S until a black screen with white text appears.
3. When you get to a shell prompt, enter the following:
mount -uw /
rm /var/db/.AppleSetupDone
shutdown -h now
4. After rebooting you should have a brand new admin account. When you login as the new admin you can simply delete the old one.
--- Makefile.in.orig 2009-08-03 18:45:31.000000000 +0100
+++ Makefile.in 2009-08-03 18:47:04.000000000 +0100
@@ -404,14 +404,10 @@
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
README COPYING EXCEPTIONS-CLIENT CMakeLists.txt
-SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
- @readline_topdir@ sql-common scripts \
+SUBDIRS = . include @zlib_dir@ \
+ @readline_topdir@ sql-common scripts \