Skip to content

Instantly share code, notes, and snippets.

@monde
monde / delayed_textfield_helper.js
Created January 16, 2013 06:43
An Ember.js TextField and that has been extended to react to a change event after a certain amount of time has passed without any other events having occurred within the TextField.
App.DelayedTextField = Ember.TextField.extend({
// FIXME
// double check that init in Ember.TextSupport / Ember.TextSupport
// isn't handling this.on("paste"...) and the internal variable is still
// this._elementValueDidChange
init: function() {
this.on("propertychange", this, this._elementValueDidChange);
this.on("keyup", this, this._elementValueDidChange);
this.on("input", this, this._elementValueDidChange);
@markjames
markjames / git.sh
Created September 1, 2011 10:04
Going git
# The following commands
# need to be run once to set-up git
# Install git (you may have this already, type git then hit [ENTER] in Terminal to check)
cd ~/Downloads && curl -OL "http://git-osx-installer.googlecode.com/files/git-1.7.6-x86_64-snow-leopard.dmg" && open ~/Downloads/git-1.7.6-x86_64-snow-leopard.dmg
# Start a new Terminal window
# I don't have a command for this one
# Install the Git Flow extension
@markjames
markjames / gist:1050886
Created June 28, 2011 10:40
Units/Groups
<style>
/*
The .unit class indicates a single page item (e.g. a latest news list). Units cannot be nested.
The .group class indicates a collection of units.
*/
.unit:before, .unit:after, .group:before, .group:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
.unit:after, .group:after { clear: both; }
.unit, .group { zoom: 1; }
@deplorableword
deplorableword / gist:917326
Created April 13, 2011 10:26
Listen to your PHP errors on Mac
tail -f /Applications/MAMP/logs/php_error.log | while read line ; do echo $line | say ; done
@sstephenson
sstephenson / gist:771090
Created January 8, 2011 19:41
Automatic *.test host resolution in OS X
$ sudo su -
# mkdir /etc/resolver
# cat > /etc/resolver/test
nameserver 127.0.0.1
port 2155
^D
^D
$ brew install dnsmasq
$ dnsmasq --port=2155 --no-resolv --address=/.test/127.0.0.1
$ ping foo.test
diff --git a/core/HTTP.php b/core/HTTP.php
index 0ce1a49..dd08567 100644
--- a/core/HTTP.php
+++ b/core/HTTP.php
@@ -346,7 +346,7 @@ class HTTP {
$responseHeaders["Cache-Control"] = "max-age=" . self::$cache_age . ", must-revalidate";
$responseHeaders["Pragma"] = "";
} else {
- $responseHeaders["Cache-Control"] = "no-cache, max-age=0, must-revalidate";
+ $responseHeaders['Vary'] = 'Cookie';
@jwage
jwage / SplClassLoader.php
Last active April 9, 2024 21:04
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,