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
// ==UserScript== | |
// @name Gmail "From" Address auto-selector | |
// @version 0.18 | |
// @description Looks in your "To" field and sees if you have an email address in your "From" addresses with the same domain. Changes <select> onblur | |
// @author Andrew Sutherland, https://github.com/asuth | |
// @include http://mail.google.com/* | |
// @include https://mail.google.com/* | |
// @include http://*.mail.google.com/* | |
// @include https://*.mail.google.com/* | |
// ==/UserScript== |
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
//Edited by 168funpc | |
var Default_isFT = 0 //ĬÈÏÊÇ·ñ·±Ì壬0-¼òÌ壬1-·±Ìå | |
var StranIt_Delay = 50 //·­ÒëÑÓʱºÁÃ루ÉèÕâ¸öµÄÄ¿µÄÊÇÈÃÍøÒ³ÏÈÁ÷³©µÄÏÔÏÖ³öÀ´£© | |
//£­£­£­£­£­£­£­´úÂ뿪ʼ£¬ÒÔϱð¸Ä£­£­£­£­£­£­£­ | |
//ת»»Îı¾ | |
function StranText(txt,toFT,chgTxt) | |
{ | |
if(txt==""||txt==null)return "" |
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 | |
class QueryStringTest extends PHPUnit_Framework_TestCase { | |
/** | |
* @covers remove_querystring_var | |
*/ | |
public function testRemoveQueryStringVar() { | |
// tests without any other querystring params |
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
/* ***** BEGIN LICENSE BLOCK ***** | |
* Version: NPL 1.1/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Netscape Public License | |
* Version 1.1 (the "License"); you may not use this file except in | |
* compliance with the License. You may obtain a copy of the License at | |
* http://www.mozilla.org/NPL/ | |
* | |
* Software distributed under the License is distributed on an "AS IS" basis, | |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
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
#!/bin/sh | |
# CRON | |
## delete encrypted backups older than 5 days | |
#55 3 * * * find /path/to/backups-enc -mtime +5 -exec rm {} \; | |
## delete un-encrypted backups older than 1 days | |
#55 3 * * * find /path/to/backups -mtime +0 -exec rm {} \; | |
## database dump at 4am UTC = 8pm PST (9pm PDT) | |
#0 4 * * * /path/to/this/script |
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 Model = Backbone.Model.extend({ | |
/** | |
* Override main attribute getter to handle mutators. | |
* Looks for an object on the model called 'mutators', keyed by key name, | |
* with values of either the getter function or an object like: | |
* { get: function() {}, set: function() {} } | |
*/ | |
get: function(attr) { | |
var val, |
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
// Queue of Backbone.Model save()s so that we don't issue multiple POSTs while waiting for | |
// the first one to come back. The first save() will always POST and the second will always PUT now. | |
// https://github.com/documentcloud/backbone/issues/345 | |
// https://gist.github.com/1037984 and https://gist.github.com/gists/3148064 | |
(function() { | |
function proxyAjaxEvent(event, options, dit) { | |
var eventCallback = options[event]; | |
options[event] = function() { | |
// check if callback for event exists and if so pass on request | |
if (eventCallback) { eventCallback(arguments) } |
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() { | |
function proxyAjaxEvent(event, options, dit) { | |
var eventCallback = options[event]; | |
options[event] = function() { | |
// check if callback for event exists and if so pass on request | |
if (eventCallback) { eventCallback(arguments) } | |
if (eventCallback) { eventCallback.apply(dit, arguments); } | |
dit.proxyProcessQueue(); // move onto next save request in the queue | |
} | |
} |
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
# imgs don't need to be gzipped | |
s3cmd put -c config/.s3cfg-prod-static --acl-public --guess-mime-type --add-header "Cache-Control:public, max-age=31536000" -r static/img s3://my-bucket-name/ | |
# js/css does need gzipping | |
rm -rf static/built-gz; | |
cp -a static/built/ static/built-gz/; | |
find static/built-gz -type f | while read -r x; do gzip -9 -c "$x" > "$x.gz"; mv "$x.gz" "$x"; done; | |
s3cmd put -c config/.s3cfg-prod-static --acl-public --guess-mime-type --add-header "Cache-Control:public, max-age=31536000" --add-header "Content-Encoding: gzip" -r static/built-gz/ s3://my-bucket-name/built/ |
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
{ | |
"Statement": [ | |
{ | |
"Sid": "AllowPublicRead", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket_name_here/*" |
OlderNewer