Skip to content

Instantly share code, notes, and snippets.

View ianchanning's full-sized avatar

Ian Channing ianchanning

View GitHub Profile
@scripting
scripting / RiverReader
Last active August 29, 2015 14:03
Minimal code for reading a river
<html>
<head>
<title>Minimal River Reader</title>
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script>
</head>
<body>
<script>
var theRiver;
function onGetRiverStream (updatedFeeds) {
theRiver = updatedFeeds;

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@markoheijnen
markoheijnen / gist:9337dc054e1224f9ba5b
Created November 19, 2014 20:11
qTranslate to Babble
- Set default language and all languages to WordPress/Babble
- Loop over all posts and load the translations inside post_content to an array
- Loop the array and skip the default language.
- Babble_Jobs->create_post_jobs( (object) $curren_post, (array) $language_codes )
- You will get post ids back and need to call the next function.
- Babble_Post_Public->initialise_translation( $original_post, $lang_code )
- For the behaviour it's best to look at Babble_Jobs->save_job() which is called by the save_post hook
- when successful the default language content should become post_content
anonymous
anonymous / config.json
Created February 12, 2015 01:40
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#99cccc",
"@brand-success": "#5cb85c",
anonymous
anonymous / config.json
Created May 4, 2015 06:03
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#99cccc",
"@brand-success": "#43ac6a",
@troelskn
troelskn / post-receive
Last active December 14, 2015 05:40
Some git-hooks for php development
#!/bin/sh
# /var/git/$REPONAME.git/hooks/
# This script just multiplexes the hook to multiple sub-scripts, since you can only have one hooks/post-receive
while read oldrev newrev refname
do
echo $oldrev $newrev $refname | /usr/share/doc/git-core/contrib/hooks/post-receive-email
echo $oldrev $newrev $refname | /home/buildbot/buildbot/scripts/post-receive-hook
done
@hubgit
hubgit / app.js
Last active December 16, 2015 21:39
Postcode -> Location lookup using Ordnance Survey Linked Data APIs
$(function() {
var form = $("form");
var button = form.find("button[type=submit]");
var input = form.find("input[name=postcode]");
var output = form.find("output[name=location]");
var map = L.mapbox.map("map", "hubbox.map-u557d78b").setView([54, 0], 6);
var failed = function(data) {
button.html("Failed");
Install-WindowsUpdate -AcceptEula
cinst Microsoft-Hyper-V -source windowsfeatures
cinst Microsoft-Hyper-V-Management-PowerShell -source windowsfeatures
@einkoro
einkoro / password_bcrypt.php
Last active May 10, 2016 16:52
Must-use plugin for WordPress to swap phpass to PHP 5.5's new password_hash and password_verify using bcrypt
<?php
/**
* Plugin Name: WP PASSWORD_BCRYPT
* Plugin URI: http://bitpiston.com/
* Description: Replaces wp_hash_password and wp_check_password's phpass hasher with PHP 5.5's password_hash and password_verify using bcrypt.
* Author: BitPiston Studios
* Author URI: http://bitpiston.com/
* Version: 1.2
* Licence: BSD
*/
@mbostock
mbostock / .block
Last active June 16, 2016 01:34
Hello, bl.ocks.org!
license: gpl-3.0