Skip to content

Instantly share code, notes, and snippets.

View schuyberg's full-sized avatar

Schuyler Lindberg schuyberg

  • The University of British Columbia
  • Vancouver, BC
View GitHub Profile
@kronda
kronda / selenium
Created October 13, 2012 02:51
Bash file for starting and stopping Selenium server
#!/bin/bash
SELENIUM=/usr/local/bin/selenium-server.jar
LOG=/var/log/selenium.log
PIDFILE=/opt/bin/selenium.pid
ARG=$1
if [ ${#ARG} -lt 1 ]
then echo "\nUSAGE: $0 {start|stop}\n"
@james2doyle
james2doyle / ProvinceState Arrays
Created November 8, 2012 16:51
PHP array for states and Provinces in Canada and the US
$provinces = array(0 => 'Alberta',
1 => 'British Columbia',
2 => 'Manitoba',
3 => 'New Brunswick',
4 => 'Newfoundland and Labrador',
5 => 'Northwest Territories',
6 => 'Nova Scotia',
7 => 'Nunavut',
8 => 'Ontario',
9 => 'Prince Edward Island',
@SimonSimCity
SimonSimCity / pagination.html.twig
Last active May 16, 2025 07:13
A gist for pagination in Twig, based on the total number of pages, the current page and some URL-settings.
{#
Source: http://dev.dbl-a.com/symfony-2-0/symfony2-and-twig-pagination/
Updated by: Simon Schick <[email protected]>
Parameters:
* currentFilters (array) : associative array that contains the current route-arguments
* currentPage (int) : the current page you are in
* paginationPath (string) : the route name to use for links
* showAlwaysFirstAndLast (bool) : Always show first and last link (just disabled)
* lastPage (int) : represents the total number of existing pages
@egaumer
egaumer / app.js
Last active July 24, 2018 13:25
Getting Started with elasticsearch and AngularJS
/*jshint globalstrict:true */
/*global angular:true */
'use strict';
angular.module('demo', [
'demo.controllers',
'demo.directives',
'elasticjs.service'
]);
@pwc3
pwc3 / Exchange Sync.applescript
Last active March 13, 2025 18:44
AppleScript to copy all of the events from an Exchange calendar to an iCloud calendar.
tell application "Calendar"
-- delete everything from the destination calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
repeat with anEvent in (get events of calendar "Destination Calendar")
delete anEvent
end repeat
-- copy all events from the source calendar to the destination
-- TODO: Change "Source Calendar" to be the name of your source calendar
-- TODO: Change "Destination Calendar" to be the name of your destination calendar
@mjsuhonos
mjsuhonos / LadderMODS.json
Last active December 17, 2015 23:08
JSON-LD syntax for mappings in Ladder
{
"@context": {
"ladder": "Ladder:",
"bibo": "http://purl.org/ontology/bibo/",
"dcterms": "http://purl.org/dc/terms/",
"foaf": "http://xmlns.com/foaf/0.1/",
"mads": "http://www.loc.gov/mads/rdf/v1#",
"mods": "http://www.loc.gov/mods/modsrdf/v1#",
"schema": "http://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#"
@torgeir
torgeir / audio-source-microphone.js
Created September 19, 2013 17:55
Microphone input as audio source js
window.AudioContext = window.AudioContext || window.webkitAudioContext;
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia;
window.addEventListener('load', init, false);
function init () {
try {
record(new AudioContext());
}
catch (e) {
@elidupuis
elidupuis / README.md
Created November 27, 2013 22:49
Simple filtering example using Stapes.js and Rivets.js

Dependencies managed with Bower:

npm install -g bower
bower install

...Then open up index.html in a browser.

@impressiver
impressiver / angular-jquery-adapter.js
Last active August 29, 2015 14:08
Angular/jQuery event wrappers
/******************************************************************************
*
* Adapter functions to deal w/ Angular <--> jQuery (custom) events
*
* I wrote these quickly just to see if they'd fly. They should really be added
* to a provider, I just haven't gotten around it.
*
*****************************************************************************/
/**
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.