Skip to content

Instantly share code, notes, and snippets.

View jaymzcd's full-sized avatar
🍜
Maybe cooking some pad thai

jaymz campbell jaymzcd

🍜
Maybe cooking some pad thai
View GitHub Profile
export NONE='\[\033[0m\]'
export WHITE_1='\[\033[0;1m\]'
export BLACK='\[\033[0;30m\]'
export GRAY='\[\033[1;30m\]'
export RED='\[\033[0;31m\]'
export LIGHT_RED='\[\033[1;31m\]'
export GREEN='\[\033[0;32m\]'
export LIGHT_GREEN='\[\033[1;32m\]'
export BROWN='\[\033[0;33m\]'
export YELLOW='\[\033[1;33m\]'
@jaymzcd
jaymzcd / watermark.sh
Created April 25, 2013 09:48
Nice and easy watermarking with imagemagick on a directory with a given mask
#!/bin/bash
# _ _____ ________________ __ ______ ____ __ __
# | | / / |/_ __/ ____/ __ \/ |/ / | / __ \/ //_/
# | | /| / / /| | / / / __/ / /_/ / /|_/ / /| | / /_/ / ,<
# | |/ |/ / ___ |/ / / /___/ _, _/ / / / ___ |/ _, _/ /| |
# |__/|__/_/ |_/_/ /_____/_/ |_/_/ /_/_/ |_/_/ |_/_/ |_|
OUTDIR=${3:-/tmp}
MASK=${2:-mask.png}
@jaymzcd
jaymzcd / gist:5098772
Last active December 14, 2015 14:09
Charlies code for demo
//test
//Set an Interval on the function to run every 10 secs
setInterval(function() {
//Get actual date
var date = new Date();
//console.log(date);
var reDate = /(\d+)\/(\d+)\/(\d+)/;
var days;
//Make comment date into actual date format
data = jQuery('a[title]').filter(function(){
@jaymzcd
jaymzcd / git-annex-overview.md
Created January 28, 2013 11:29
Quick overview of git-annex - quite liking it

Git Annex

git annex - this is a separate bit of software that sits "atop" git and lets you (in it's words):

allows managing files with git, without checking the file contents into git.

Say what!? It basically stores your directory contents in git via symlinks, so really you are just checking in a bunch of symlinks - not content. This keeps the repo very small.

@jaymzcd
jaymzcd / .gitignore
Created November 28, 2012 18:12
Currrent .gitignore
# Python & C stuff
# ----------------
*.pyc
*.o
# Backup/Temp/OS files
# --------------------
*~
\.DS_Store
\.Thumbs_db
@jaymzcd
jaymzcd / inifite_scrolling_bg.js
Created October 7, 2012 20:37
Infinitely scroll the background of an element with jquery
var SCROLL_TIME = 120; // seconds to scroll through
$(document).ready(function () {
var scrollingContent = function() {
console.log("Scrolling background");
$('.container').css('background-position-y', 0);
$('.container').animate({
'background-position-y': -1 * $(this).height()
}, SCROLL_TIME * 1000, 'linear', scrollingContent);
@jaymzcd
jaymzcd / gist:3748713
Created September 19, 2012 09:37
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@jaymzcd
jaymzcd / goulsash.md
Created August 2, 2012 16:31
Sausage goulash!

Super mega cheap tasty goulash

Prep!

First! after my roast dinner on sunday, i made chicken stock by boiling a carcass with onion & carrot for 3 hours, then strained it and then chilled and removed the fat that floated out.

The main thing

for the goulash itself i did:

Traceback (most recent call last):
File "/home/ph/trunk/python-hosting.com/new_site/scripts/create_app.py",
line 1379, in ? raise "Unknown Wordpress version: %s" % ext Unknown Wordpress version: 34
@jaymzcd
jaymzcd / html5_geolocate.html
Created June 26, 2012 12:35
geo locate via html5 js, modified from html5 demo site
<meta name="viewport" content="width=620" />
<style type="text/css">
body {
width: 800px;
margin: 0 auto;
}
</style>
<h1>HTML5 Geolocation Example</h1>