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
global.debug = ( ) -> | |
tabs = ( n ) -> ( "\t" for i in [0...n] ).join( '' ) | |
for i in [0...arguments.length] | |
arg = arguments[i] | |
type = get_type arg | |
# last arg is boolean? sleep if true | |
if ( i + 1 ) is arguments.length and type is 'Boolean' | |
if arg |
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
Action compile-sass /git/phpsass/compile-apache.php | |
AddHandler compile-sass .sass .scss |
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 templates = window['templates'] = {} | |
$.get('assets/html', function(data) { | |
$('a[href*=html]', data).each(function() { | |
$.get('assets/html/' + $(this).attr('href'), function(data) { | |
_name = this.url.split('/').pop().split('.') | |
_name.pop() | |
path = templates | |
for (var i = 0; i < _name.length; i++) { | |
segment = _name[i] |
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 mix-alpha($color, $bg) { | |
@return mix(opacify($color, 1), opacify($bg, 1), alpha($color) * 100); | |
} | |
@mixin safe-color($color, $bg) { | |
background: mix-alpha($color, $bg); | |
background: $color; | |
} | |
body { |
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 | |
Route::filter('after', function($response) | |
{ | |
$format = Input::get('format', Config::get('application.default_mutator')); | |
$response->mutator = $format; | |
}); | |
Route::mutator('string', function($response) { |
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 | |
Route::filter('cache', function($response = NULL) { | |
$cname = 'response-' . Str::slug(URI::full()); | |
if (!$response) { | |
return Cache::get($cname); | |
} | |
else if ($response->status == 200) { | |
$ctime = floor(pow(current(sys_getloadavg()) + 1, 5)); # cache for between 1 and 32 minutes | |
Cache::put($cname, $response, $ctime); |
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 mod($l, $r) { | |
@while ($l - $r) >= 0 { | |
$l: $l - $r; | |
} | |
@return abs($l); | |
} | |
@for $i from 1 through 100 { | |
#{$i} { | |
@if mod($i, 3) == 0 and mod($i, 5) == 0 { |
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
div { | |
background: #f00; | |
-webkit-transition: background 1000s linear; | |
-moz-transition: background 1000s linear; | |
transition: background 1000s linear; | |
} | |
div:hover { | |
background: #00f; | |
-webkit-transition: none; |
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
diff --git a/laravel/validator.php b/laravel/validator.php | |
index 0c84e8e..1a09bff 100644 | |
--- a/laravel/validator.php | |
+++ b/laravel/validator.php | |
@@ -584,7 +584,7 @@ class Validator { | |
*/ | |
protected function validate_alpha($attribute, $value) | |
{ | |
- return preg_match('/^([a-z])+$/i', $value); | |
+ return $this->validate_match($attribute, $value, 'a-z'); |
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
$ = jQuery | |
jQuery.fn.number = (options) -> | |
defaults = | |
min: null | |
max: null | |
step: 1 | |
pattern: /^(-?[0-9\.]*)$/ | |
default_prefix: '' | |
default_suffix: '' | |
change_on_click: true |