This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generated user.js | |
function User() { // @extends Backbone.Model | |
return Backbone.Model.apply(this, arguments); | |
} | |
User.prototype = Backbone.Model.prototype; | |
User.EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
User.prototype.validate = function validate() { | |
var email = this.get('email'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Class | |
def initialize(*vars) | |
keys = vars.map{ |k| k.to_s.sub(/^@/, '')} | |
define_method :initialize do |args| | |
args.each_pair do |k,v| | |
raise ArgumentError, "Unexpected argument #{k}" unless keys.include?(k.to_s) | |
instance_variable_set "@#{k}", v | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Song | |
# Regular expressions | |
RE = { | |
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i, | |
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i, | |
:mashup_split => / \+ | x | vs\.? /i, | |
:producer => /^(produced by|prod\.? by |prod\. )/i, | |
:cover => / cover/i, | |
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three" | |
:open => /[\(\[\{]/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require our new directive | |
var resolveSprockets = require(__dirname + '/resolve-sprockets.js'); | |
// set files to the array that we got back | |
var files = resolveSprockets('spec.js.coffee'); | |
// Here goes the rest as usual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
=begin | |
Simple script to smack your glitch up. | |
Call this program with the name of an image file, and two numbers | |
The first number is used to determine when to mess with a byte in the | |
image file. If you pass in, say 2000, then even 2000th byte gets tweaked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.I18n = | |
en: | |
title: "Free YouTube video download" | |
navi: | |
home: "Home" | |
howto: "Tutorial" | |
blog: "Blog" | |
termsofuse: "Terms of Use" | |
support: "Support" | |
imprint: "Imprint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2012 Eike Send | |
* | |
* 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: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i source.mov -c:v libx264 -crf 18 -profile:v high -level 4.0 -pix_fmt yuv420p -preset veryslow -tune animation output.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
// buffer constraints | |
#define BUFFER_WIDTH 80 | |
#define BUFFER_HEIGHT 22 | |
#define BUFFER_SIZE (BUFFER_WIDTH*BUFFER_HEIGHT) | |
#define IMAGE_SCALE 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsfiddle.net/suBPQ/ | |
$.ajax({ | |
url: "http://api_test_server.proudlygeek.c9.io/", | |
success: function(data) { | |
console.log(data); | |
} | |
}); |
OlderNewer