Skip to content

Instantly share code, notes, and snippets.

View chardcastle's full-sized avatar

Chris Hardcastle chardcastle

  • London (England)
View GitHub Profile
@gabrielstuff
gabrielstuff / jquery.mask.js
Created May 17, 2013 23:00
Using jquery to make a masked element draggable.
/*from http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/
Added compatibility with iOS touch devices
HTML should be something like :
<div class="container">
<img id="image1" class="erb-image-wrapper" src="test.jpg"> <!-- this is your masked element -->
<img id="image2" class="erb-image-wrapper" src="femme.png" style="cursor: move;"> <!-- this is your mask over the masked element-->
</div>
*/
@5eleven
5eleven / Capistrano.Mysql
Created July 26, 2012 01:19
Capistrano task to pull MySQL production data to develoment database
# Fetches the production database on the server contents into the development
# database
#
# Assumes you have dbuser, dbhost, dbpassword, and application defined somewhere in your
# task. Modify as needed - database.yml is used for importing data, just not for exporting.
#
# Only supports MySQL.
desc "Load production data into development database"
task :fetch_remote_db, :roles => :db, :only => { :primary => true } do
require 'yaml'
@dsheiko
dsheiko / strtr.js
Last active July 9, 2023 18:18
Java-script strtr — translate characters or replace substrings
/**
* strtr() for JavaScript
* Translate characters or replace substrings
*
* @author Dmitry Sheiko
* @version strtr.js, v 1.0.2
* @license MIT
* @copyright (c) Dmitry Sheiko http://dsheiko.com
**/