Skip to content

Instantly share code, notes, and snippets.

View colourgarden's full-sized avatar

Tom Hare colourgarden

View GitHub Profile
@balupton
balupton / README.md
Last active April 20, 2022 13:21
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
@danott
danott / modernizr-tests.js
Created March 4, 2011 16:55
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@mxriverlynn
mxriverlynn / 1-ModelWithChangedEvents.js
Created June 15, 2011 03:12
simple backbone.js examples
var SomeModel = Backbone.Model.extend({});
someModel = new SomeModel();
someModel.bind("change", function(model, collection){
alert("You set some_attribute to " + model.get('some_attribute'));
});
someModel.set({some_attribute: "some value"});
@jdennes
jdennes / LICENSE
Last active March 7, 2024 04:40
Subscribing to a Campaign Monitor list using AJAX
The MIT License (MIT)
Copyright (c) James Dennes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@makeusabrew
makeusabrew / 1) uglify.js
Created October 25, 2011 11:54
Watch a specified directory's JavaScript files and recompile a specified output file if any changes are detected
/**
* Sample usage - note that the trailing slash on the watch directory is important!
*
* node uglify.js /path/to/my/src/directory/ /path/to/my/output/file.js
*/
var jsp = require('uglify-js').parser,
pro = require('uglify-js').uglify,
fs = require('fs');
@mattbrailsford
mattbrailsford / RobotsTxtCheck.cs
Created October 29, 2011 16:42
An example uGoLive check
namespace Our.Umbraco.uGoLive.Checks
{
[Check("8088E981-174C-4ABA-9867-AF219B4E0D9E", "Robots.txt", "Create a robots.txt file to block access to system folders", "SEO")]
public class RobotsTxtCheck : AbstractCheck
{
public override bool CanRectify
{
get { return false; }
}
@fabianmarz
fabianmarz / Preferences.sublime-settings
Last active June 5, 2017 12:42
Sublime Text config
{
"always_show_minimap_viewport": true,
"animation_enabled": false,
"auto_complete_selector": "source, text",
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/ayu/ayu-mirage.tmTheme",
"default_line_ending": "unix",
"ensure_newline_at_eof_on_save": true,
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@Vestride
Vestride / encoding-video.md
Last active June 5, 2024 14:38
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus