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
require 'resque/errors' | |
class DatabaseBackupJob | |
def self.perform(id, foo, bar) | |
# do backup work | |
rescue Resque::TermException | |
# write failure to database | |
# re-enqueue the job so the job won't be lost when scaling down. | |
Resque.enqueue(DatabaseBackupJob, id, foo, bar) |
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
# The second way is recommended, which is flexible, and also work for non jQuery ajax library. | |
# Setup sinon sandbox | |
beforeEach -> | |
@sinon = sinon.sandbox.create() | |
afterEach -> | |
@sinon.restore() |
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
/** | |
* requestAnimationFrame polyfill by Erik Möller & Paul Irish et. al. | |
* https://gist.github.com/1866474 | |
* | |
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
**/ | |
/*jshint asi: false, browser: true, curly: true, eqeqeq: true, forin: false, newcap: true, noempty: true, strict: true, undef: true */ |
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/bash | |
FILE="/var/www/${1}.sql" | |
echo "Delete remote dump [${FILE}]" | |
ssh root@178.79.163.176 "rm -rf ${FILE}" | |
echo "Remote database dump" | |
ssh root@178.79.163.176 "mysqldump --user=root --password=XYZ ${1} > ${FILE}" |
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
<html> | |
<head> | |
<script type="text/template" id="tpl-tumblr-post"> | |
<% if(title){ %> | |
<h2 class="title"> | |
<a href="<%= post_url %>"><%= title %></a> | |
</h2> | |
<% } %> | |
<%= body %> |
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 | |
/** | |
* Custom configuration bootstrap file for ExpressionEngine | |
* | |
* Place config.php in your site root | |
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/config.php | |
* Add require(realpath(dirname(__FILE__) . '/../../config_bootstrap.php')); to the bottom of system/expressionengine/config/database.php | |
* If you have moved your site root you'll need to update the require_once path | |
* |
NewerOlder