Skip to content

Instantly share code, notes, and snippets.

View frankmullenger's full-sized avatar

Frank Mullenger frankmullenger

View GitHub Profile
@briceburg
briceburg / MultiFormMultiStep.php
Last active August 29, 2015 14:01
MultiFormMultiStep > A SilverStripe MultiForm Step allowing for a dynamic number of questions/answers. Useful for CMS generated surveys &c.
<?php
/**
* MultiFormMultiStep allows answers to be collected for a dynamic number of
* questions as a single MultiFormStep. This is useful if you have an unknown
* amount of questions (e.g. dynamically generated by a CMS based survey maker).
*
* Define the next and previous steps as usual -- but to get to the next step,
* isLastQuestion must return true. Similarly, to get to the previous step
* isLastQuestion must return true.
@plukevdh
plukevdh / crunchy_pubsub.js
Created October 21, 2011 00:10
Faux pubsub. Could also use jQuery event binding if you rather.
crunch.pubsub = _.extend({}, Backbone.Events);
// Hide backbone implementation by aliasing
crunch.pubsub.publish = crunch.pubsub.trigger;
crunch.pubsub.subscribe = crunch.pubsub.bind;
crunch.pubsub.unsubscribe = crunch.pubsub.unbind;
@wilr
wilr / .htaccess
Created August 6, 2012 06:26
XHProf
php_value auto_prepend_file header.php
php_value auto_append_file footer.php
@dhensby
dhensby / silverstripe-deploy.sh
Last active January 13, 2017 21:13
Simple local SilverStripe deploy script for Fedora/CentOS/RHEL
#!/usr/bin/env bash
BU=true
CO=true
BUILD=true
TARGET='master'
DB_USER=''
DB_PASS=''
DB_HOST=''
DB_NAME=''

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@raphaelstolt
raphaelstolt / php54_php53_pear_macports.markdown
Created May 17, 2012 21:37
Installing PHP 5.4 and 5.3 side by side on Max OSX via MacPorts

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@yelkhatib
yelkhatib / domainNames.sh
Last active August 18, 2023 17:07
Get a list of unique resource domains from a HAR file. Uses jq to parse the HAR file.P.S. You could create HAR files using a number of tools, such as PhantomJS, hdrgrab or chrome-HAR-capturer.
#list unique resource domains
jq '.log.entries[].request | {method,url}' $1 | jq 'if .method=="GET" then .url else "" end' | grep -Eo "http(s?)://([^/]+)./" | sort | uniq
@wilr
wilr / export.sql
Created February 8, 2011 02:12
Generates a list of all the suburbs and regions (with lat/lngs in NZ). Uses a timeout interval to prevent issues with the google geocoder. If you're too lazy to wait for that script to run, the SQL is attached below. I accept no responsibility for the acc
# ************************************************************
# Sequel Pro SQL dump
# Version 3348
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: localhost (MySQL 5.1.54)
# Generation Time: 2011-07-10 19:08:36 +1200
# ************************************************************