This file contains hidden or 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
//////////////////////////////////////////////////////////////////////////////// | |
// Type utils | |
var is_object = function(o) { return o !== null && typeof o === 'object'; }; | |
var is_number = function(o) { return !isNaN(parseFloat(o)) && isFinite(o); }; | |
var is_string = function(o) { return typeof o === 'string'; }; | |
var is_regexp = function(o) { return Object.prototype.toString.call( o ) === '[object RegExp]'; }; | |
var is_regexp_duck = function(o) { return !!(o && o.test && o.exec && (o.ignoreCase || o.ignoreCase === false)); }; | |
var get_internal_type = function(o) { return Object.prototype.toString.call(o).slice(8, -1); }; |
This file contains hidden or 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
(function(window, undefined) { | |
"use strict"; | |
// @function func.apply( thisArg [, argsArray ] ) | |
// @function func.call ( thisArg [, arg1 [, arg2 [, ...] ] ] ) | |
var _applyIndirect = function(func, thisArg, argsArray) { | |
Function.prototype.apply.call(func, thisArg, argsArray); | |
}; |
This file contains hidden or 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://perfectionkills.com/how-ecmascript-5-still-does-not-allow-to-subclass-an-array/ | |
(function(window, undefined) { | |
"use strict"; | |
var _extend = function() { | |
var a = [ ]; | |
args = Array.prototype.slice.call(arguments); | |
a.push.apply(a, args); |
This file contains hidden or 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
# this.rb c:/path/to/scan > npp.workspace.xml | |
def puts(*args) | |
Kernel.puts *args | |
end | |
def scan_path(parent, indent='') | |
paths = Dir.glob(File.join(parent, '*')) | |
paths.select{ |path| !File.directory? path }.sort.each do |file| |
This file contains hidden or 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
def wget(url,file) | |
require 'net/http' | |
require 'uri' | |
if (!file) | |
file = File.basename(url) | |
end | |
url = URI.parse(url) | |
Net::HTTP.start(url.host) do |http| |
This file contains hidden or 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
def require_signature(file) | |
abort file+' is not signed!' if !SignTool.is_signed file | |
end | |
def warn_if_not_signed(file) | |
puts '---- WARNING ---- '+file+' is not signed!' if !SignTool.is_signed file | |
end | |
class SignTool |
This file contains hidden or 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
# Workspace files | |
*.iw7 | |
*.iw9 | |
# Build log files | |
*.log |
This file contains hidden or 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
## Normal git log | |
git log -3 | |
# commit 58c7c712ad122bb4739a761d71684dcb23364831 | |
# Author: Nathan Perry <[email protected]> | |
# Date: Wed Mar 19 22:10:39 2014 -0400 | |
# | |
# Update README.md | |
# | |
# commit cd3137dad3d7debd622885445e0d117246b65603 |
This file contains hidden or 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 'docile' | |
require 'linguistics' | |
Linguistics.use :en | |
class BuilderConfig | |
def initialize | |
@paths = @@paths | |
@versions = @@versions |
This file contains hidden or 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
## db/seeds.rb | |
['all', Rails.env].each do |seed| | |
seed_file = Rails.root.join('db', 'seeds', "#{seed}.rb") | |
if File.exists?(seed_file) | |
puts "*** Loading #{seed} seed data" | |
require seed_file | |
end | |
seed_dir = Rails.root.join('db', 'seeds', seed) |
OlderNewer