Skip to content

Instantly share code, notes, and snippets.

@Relequestual
Relequestual / request_schema.json
Created November 3, 2014 12:03
MatchMakerExchange Search Request json-schema file which can be used for validation of MME requests. This is used in the Decipher project at time of posting.
{
"type":"object",
"$schema": "http://json-schema.org/draft-03/schema",
"title": "MatchMakerExchange Search Request",
"name": "MatchMakerExchangeSearchRequest",
"required":true,
"properties":{
"id": {
"type":"string",
"maxLength":255,
@Relequestual
Relequestual / keybase.md
Created November 11, 2014 10:24
keybase.md

Keybase proof

I hereby claim:

  • I am Relequestual on github.
  • I am relequestual (https://keybase.io/relequestual) on keybase.
  • I have a public key whose fingerprint is C55E 97EB 864D 2984 91BE 35F2 476E C3A2 DB2A 4974

To claim this, I am signing this object:

PHP on Pow.cx

Install Pow

$ curl get.pow.cx | sh

Install PHP with MySQL

$ curl -O https://raw.github.com/gist/4129846/7ae1709453a8a19ce9c030bf41d544dd08d96d85/php.rb

$ mv php.rb brew --prefix/Library/Formula

@Relequestual
Relequestual / blog_model.php
Created February 19, 2012 22:33
CodeIgniter blog_model pisyek tut
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Blog_model extends CI_Model {
function __construct() {
parent::__construct();
//var_dump(get_instance()); exit;
// $CI = get_instance();
// $CI->load->database();
@Relequestual
Relequestual / localive.js
Created March 18, 2012 19:00 — forked from RonnyO/localive.js
Conditional loading of live.js for dev environments
// Load live.js on local envs only
// Make sure the path is right and your dev env passes the test.
/* Delete these characters to disable it temporarily -> */
(function() {
if(/^https?:\/\/(localhost|127.0.0.1|(dev|test).*?)\/|^file:\/\/\//.test(document.location.href)) {
var live = document.createElement('script');
live.src = 'js/live.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(live, s);
@Relequestual
Relequestual / gist:2230990
Created March 28, 2012 22:11
Split a string which starts with lowercase then uses camel case from first capital letter.
<?php
/*
/ Created while using the Last.FM API.
/ The Last.FM API is split into sections. Artists, Album, Track etc.
/ The method names are for example "artists.getTopTracks". If I'm using magic method __call
/ and calling artistsGetTopTracks, I can then split the call down into the section and method with the following regex
/ which can then be used to construct API call URL
*/
preg_match_all('/^[a-z]*|[A-Z]\w*/', $candidate, $results);
@Relequestual
Relequestual / helper.js
Created September 5, 2012 10:46
Remove helper text when given focus and re-display helper text when loose focus and empty
$("input, textarea").focus(function(){
if ($(this).val() == $(this).attr("title")) {
$(this).val("");
}
}).blur(function () {
if ($(this).val() == "") {
$(this).val($(this).attr("title"));
}
});
@Relequestual
Relequestual / remove.sql
Created September 20, 2012 13:52
Remove hidden character copied from Adobe (Ps, Ai) from mysql database
# Replace TABLE and COLUMN as appropriate
Update TABLE Set COLUMN = Replace(COLUMN, CHAR(3), '');
@Relequestual
Relequestual / robot.js
Created December 6, 2012 09:13
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {
@Relequestual
Relequestual / robot.js
Created December 6, 2012 09:13
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {