Skip to content

Instantly share code, notes, and snippets.

@wrightlabs
wrightlabs / mysql2sqlite.sh
Created May 11, 2012 22:47 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# FORKED FROM https://gist.github.com/943776 (SEE FOR DOCUMENATION)
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
@wrightlabs
wrightlabs / cacheforever.php
Created February 7, 2012 22:35
php header cache forever
header('Cache-Control: max-age=31556926');
$etag = 'a_unique_version_string';
header('ETag: "'.$etag.'"');
$this->load->library('tank_auth');
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'spira'
require 'rack/linkeddata'
use Rack::LinkedData::ContentNegotiation, :default => 'text/turtle'
include RDF
<?php
// Author: John Wright
// Website: http://johnwright.me/blog
// This code is live @
// http://johnwright.me/code-examples/sparql-query-in-code-rest-php-and-json-tutorial.php
function getUrlDbpediaAbstract($term)
{
$format = 'json';