Skip to content

Instantly share code, notes, and snippets.

View TechnotronicOz's full-sized avatar
🦖

Matt Carter TechnotronicOz

🦖
View GitHub Profile
class Dog
constructor: (@name) ->
growl: -> console.log '*growl*'
class Yorkie extends Dog
constructor: (name, @tricks = []) ->
super name #expose name to/from parent (class Dog)
perform: (trick) -> console.log if trick in @tricks then "#{name} is doing #{trick}" else '*whining*'
growl: (person) ->
if person is @master
@TechnotronicOz
TechnotronicOz / gist:4733214
Created February 7, 2013 18:56
r.js gruntfile
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-exec');
grunt.initConfig({
exec: {
build: {
command: 'node node_modules/requirejs/bin/r.js -o require-config.js'
}
}
});
var hawkApp = (function (internalApp) {
internalApp.initialize = function() {
loadBackstretch(), loadBody();
};
loadBody = function() {
return $('body').addClass('loaded');
},
@TechnotronicOz
TechnotronicOz / main.coffee
Created February 26, 2013 23:33
Backbone Router
class hawk.router extends Backbone.Router
routes:
'': 'default'
'contact': 'openContact'
'work': 'openWork'
'work/:id': 'openProject'
'about': 'openAbout'
openContact: ->
console.log 'openContact'
@TechnotronicOz
TechnotronicOz / loader.coffee
Created February 26, 2013 23:34
Modernizr Load
Modernizr.load [
load: "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
complete: ->
Modernizr.load "js/vendor/jquery-1.9.1.min.js" unless window.jQuery
,
load: ["//use.typekit.net/iyl5mxg.js"]
complete: ->
try
Typekit.load()
@TechnotronicOz
TechnotronicOz / gist:5050117
Created February 27, 2013 18:11
Description
# loader.coffee
Modernizr.load [
load: "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"
complete: ->
Modernizr.load "js/vendor/jquery-1.9.1.min.js" unless window.jQuery
,
load: ["//use.typekit.net/iyl5mxg.js"]
complete: ->
try
@TechnotronicOz
TechnotronicOz / core.js
Created February 28, 2013 18:07
Search
CPAR.ajaxSearch = CPAR.ajaxSearch || (CPAR.ajaxSearch = {
$searchResults: $('#search-results'),
$searchButton: $('#search-button'),
$searchInput: $('#searchText'),
$searchCountry: $('#countryCollection'),
loadingDiv: '.loading',
parseResults: function(data) {
var dataString = '';
@TechnotronicOz
TechnotronicOz / core.js
Created February 28, 2013 20:19
Search
CPAR.ajaxSearch = CPAR.ajaxSearch || (CPAR.ajaxSearch = {
$searchResults: $('#search-results'),
$searchButton: $('#search-button'),
$searchInput: $('#searchText'),
$searchCountry: $('#countryCollection'),
loadingDiv: '.loading',
parseResults: function(data) {
var dataString = '';
module.exports = function(grunt) {
output_dir = 'htdocs/',
source_dir = 'src/',
temp_dir = source_dir + 'temp/';
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-image-embed');
// Output dirs
module.exports = function(grunt) {
output_dir = 'htdocs/',
source_dir = 'src/',
temp_dir = source_dir + 'temp/';
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-image-embed');
// Output dirs