Skip to content

Instantly share code, notes, and snippets.

View kriskelly's full-sized avatar

Kristopher Kelly kriskelly

View GitHub Profile
@kriskelly
kriskelly / routing.php
Last active December 21, 2015 14:02
Routing file for running Omeka 2.x on a PHP dev server.
<?php
// You can run this like so:
// cd path/to/your/omeka/installation
// php -S localhost:5000 routing.php
// Stackoverflow: http://stackoverflow.com/questions/834303/startswith-and-endswith-functions-in-php
function endsWith($haystack, $needle) {
// search forward starting from end minus needle length characters
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
// Copyright 2004-present Facebook. All Rights Reserved.
/**
* Immutable data encourages pure functions (data-in, data-out) and lends itself
* to much simpler application development and enabling techniques from
* functional programming such as lazy evaluation.
*
* While designed to bring these powerful functional concepts to JavaScript, it
* presents an Object-Oriented API familiar to JavaScript engineers and closely
* mirroring that of Array, Map, and Set. It is easy and efficient to convert to
@kriskelly
kriskelly / analyse_watchers.js
Last active September 3, 2015 16:04 — forked from DTFagus/analyse_watchers.js
Bookmarklet to analyse angular watchers
javascript: (function() {
var root = angular.element(document.getElementsByTagName('html'));
var watchers = [];
var attributes = [];
var attributes_with_values = [];
var elements = [];
var elements_per_attr = [];
var scopes = [];