Skip to content

Instantly share code, notes, and snippets.

View rgbink's full-sized avatar

Anthony DeCrescenzo rgbink

View GitHub Profile
// Include Color Thief Script
// https://github.com/lokesh/color-thief
function colorChange(){
//Be sure to include <img id="coverImage" src="" alt=""/>
var $myImage = $("#coverImage");
var colorThief = new ColorThief();
//Grabs 8 swatch color palette from image and sets quality to 5 (0 =slow, 10=default/fast)
var cp = colorThief.getPalette($myImage[0], 8, 5);
@rgbink
rgbink / Terminal Notifier CLI Syntax [Mac]
Created April 29, 2015 14:11
Terminal Notifier command line syntax
/usr/bin/terminal-notifier -title 'Clinical Trials...' -message 'have been updated. Click to view.' -activate 'com.apple.Finder' -open 'file:///private/tmp/clinical_trial/' -group 'P4P'

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@rgbink
rgbink / README.md
Last active August 29, 2015 14:20 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

How to set up Gulp with an ExpressionEngine project

I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).

Install Node.js

  • If Node is not yet installed on the machine, it will need to be installed

Install Gulp (if needed)

(function($){
$(function(){
var $form = $('#search'), // Search form
$target = $('#results'), // Results container
rp = 'search/ajax-results'; // Template for results only
// Function to execute on success
var success = function(data, status, xhr) {
$target.html(data);
};

Required:

Stash 2.3.4 (beta) or later

Stash template directory

	/layouts/
		standard.html

	/partials/

listing.html

@rgbink
rgbink / [jQuery] Set columns to equal heights.js
Last active August 29, 2015 14:21
Set columns to equal heights
$(document).ready(function() {
$.fn.setAllToMaxHeight = function() {
return this.height(Math.max.apply(this, $.map(this, function(e) {
return $(e).height();
})));
};
$(window).load(function() {
@rgbink
rgbink / Bootstrap 3 Media Breakpoints [standard].css
Last active August 29, 2015 14:21
Bootstrap 3 Media Breakpoints [standard]
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@rgbink
rgbink / dropbox-sync-script.sh
Created May 19, 2015 14:08
Dropbox Sync Script
#!/bin/bash
# h/t Roger Chen, http://code.rogerhub.com/terminal-fu/53/backing-up-dropbox-with-rsync/
DIR=$HOME/Dropbox
read -p "The target directory is: $DIR. Correct? [yn] " -n 1
if [[ $REPLY =~ ^[Yy]$ ]];then
if [ -d $DIR ];then
echo -e "\n"
rsync -vauzh --progress --exclude '.dropbox*' --delete $DIR home:~/backup/dropbox