This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch of the current git/mercurial repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen(){ | |
// example send for Sheets | |
sendGAMP("UA-XXXX-1", SpreadsheetApp.getActiveSpreadsheet().getUrl()); | |
// example send for Documents | |
//sendGAMP("UA-XXXX-1", DocumentApp.getActiveDocument().getUrl()); | |
// example send for Forms *NOTE* getUrl not implemented yet in New Sheets | |
//sendGAMP("UA-XXXX-1", FormApp.getActiveForm().getUrl()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slugify($string, $replace = array(), $delimiter = '-') { | |
// https://github.com/phalcon/incubator/blob/master/Library/Phalcon/Utils/Slug.php | |
if (!extension_loaded('iconv')) { | |
throw new Exception('iconv module not loaded'); | |
} | |
// Save the old locale and set the new locale to UTF-8 | |
$oldLocale = setlocale(LC_ALL, '0'); | |
setlocale(LC_ALL, 'en_US.UTF-8'); | |
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:13.04 | |
MAINTAINER Johnny Broadway "[email protected]" | |
RUN apt-get update | |
RUN apt-get install -y wget git vim postfix nginx sqlite | |
RUN apt-get install -y mysql-server mysql-client | |
RUN apt-get install -y php5-cli php5-common php5-mysql php5-sqlite php5-curl php5-fpm | |
RUN wget -O /etc/nginx/sites-available/default https://gist.github.com/jbroadway/6369183/raw/682a1ed8078cc39f59c3624f460b128addff95db/nginx-default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Parse Opera's bookmarks.adr file. | |
*/ | |
class Opera_Bookmarks_Parser { | |
/** @var string path to bookmarks.adr */ | |
public $adr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: iFrame Your WP | |
Description: Allow people to embed your latest posts in an iFrame | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.me | |
License: GPL2 | |
*/ | |
register_activation_hook( __FILE__ , 'wpse32725_activation' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
////////////////// | |
// Screens | |
////////////////// | |
// Posts | |
foreach ( array( | |
'posts', 'pages', 'recipe_posts', | |
'edit-post', 'edit-page', 'edit-recipe', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'), | |
toBytes = require('./utf8.js').toBytes, | |
toUTF8Bytes = require('./utf8.js').toUTF8Bytes, | |
fromUTF8Bytes = require('./utf8.js').fromUTF8Bytes; | |
assert.deepEqual(toBytes(0x0), [0]); | |
assert.deepEqual(toBytes(0xff), [0xff]); | |
assert.deepEqual(toBytes(0x01ff), [0x01, 0xff]); | |
assert.deepEqual(toBytes(0xffff), [0xff, 0xff]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// @link http://books.google.com/books?id=fvA7zLEFWZgC&pg=PA61&lpg=PA61#v=onepage&q&f=false | |
function nice_labels( $min, $max, $ticks = 5 ) { | |
$range = nice_number( $max, false ); | |
$d = nice_number( $range / ( $ticks - 1 ) ); | |
$graphmin = floor( $min / $d ) * $d; | |
$graphmax = ceil( $max / $d ) * $d; | |
$nfrac = max( array( - floor( log( $d, 10 ) ), 0 ) ); |