This file contains 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
#!/bin/sh | |
# http://stackoverflow.com/a/2179876/1644422 | |
for FILE in $(git ls-files) | |
do | |
TIME=$(git log --pretty=format:%cd -n 1 --date=iso $FILE) | |
TIME=$(date -j -f '%Y-%m-%d %H:%M:%S %z' "$TIME" +%Y%m%d%H%M.%S) | |
touch -m -t $TIME $FILE | |
done |
This file contains 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
#!/bin/sh | |
find $PWD -type d -name .git \ | |
| xargs -n 1 dirname \ | |
| sort \ | |
| while read line; do echo $line && cd $line && git pull; done |
This file contains 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
/** | |
* Fix element positioning when using adminbar | |
*/ | |
@mixin fixed-top( $space, $property: "top", $factor: 1 ) { | |
#{$property}: $space * $factor; | |
.admin-bar & { | |
#{$property}: ($space + 46px) * $factor; | |
@media (min-width: 783px) { | |
#{$property}: ($space + 32px) * $factor; | |
} |
This file contains 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
ko.subscribable.fn.subscribeChanged = function( callback ) { | |
var oldValue; | |
return [ | |
this.subscribe( function( _oldValue ) { | |
oldValue = _oldValue; | |
}, this, 'beforeChange' ), | |
this.subscribe( function( newValue ) { | |
callback( newValue, oldValue ); | |
} ) | |
]; |
This file contains 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
ko.bindingHandlers.chosen = { | |
listenBindings: ['value', 'disable', 'options', 'foreach'], | |
init: function( element, valueAccessor, allBindings ) { | |
var options = ko.unwrap(valueAccessor()), $_ = $(element); | |
$_.chosen( $.extend( options, { | |
width: '100%', | |
} ) ); | |
ko.computed(function() { | |
$.each(ko.bindingHandlers.chosen.listenBindings, function( i, binding ) { |
This file contains 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
VERSION BUILD=8530828 RECORDER=FX | |
SET !ERRORIGNORE YES | |
TAB T=1 | |
SET !LOOP 1 | |
TAG POS={{!LOOP}} TYPE=A ATTR=CLASS:uiMediaThumb* EXTRACT=href | |
TAB OPEN | |
TAB T=2 | |
URL GOTO={{!EXTRACT}} | |
SET !EXTRACT NULL |
This file contains 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 | |
/* | |
Plugin Name: Registeration Anti-Spam | |
Plugin URI: https://gist.github.com/louy/6212415 | |
Description: Block Spam attacks on wp registeration page. | |
Author: Louy Alakkad | |
Version: 1.0 | |
Author URI: http://l0uy.com/ | |
*/ |
This file contains 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
# add as many as you need... | |
SetEnvIf CF-IPCountry SY RedirectSubdomain=syria | |
SetEnvIf CF-IPCountry AE RedirectSubdomain=uae | |
SetEnvIf CF-IPCountry EG RedirectSubdomain=egypt | |
# Only redirect if Host is not a subdomain | |
SetEnvIfNoCase Host ^.+\.example\.com$ !RedirectSubdomain | |
# Only redirect if cookie "noredirect" doesn't exist | |
SetEnvIfNoCase ^Cookie$ noredirect=true !RedirectSubdomain |
This file contains 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
Date.prototype.julianDay = function(){ | |
return (this / 86400000) - (this.getTimezoneOffset()/1440) + 2440587.5; | |
}; |
This file contains 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 AppRouter = Backbone.Router.extend({ | |
route: function(a,b,c) { | |
var self=this; | |
function _run(f) { | |
var g = Array.prototype.slice.apply(arguments, [1]); | |
if( self.before.apply(self, [a,g]) ) { | |
f.apply(self,g); | |
self.after.apply(self, [a,g]) | |
} | |
} |