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
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
# 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
// 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
(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
//////////////////////////////////////////////////////////////////////////////// | |
// 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); }; |
NewerOlder