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) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
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
function doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { | |
var k = UInt32(str, currentIndex); | |
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
var flattenObject = function(ob) { | |
var toReturn = {}; | |
for (var i in ob) { | |
if (!ob.hasOwnProperty(i)) continue; | |
if ((typeof ob[i]) == 'object') { | |
var flatObject = flattenObject(ob[i]); | |
for (var x in flatObject) { | |
if (!flatObject.hasOwnProperty(x)) continue; |
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
Vagrant::Config.run do |config| | |
config.vm.define :puppetserver do |puppetserver_config| | |
puppetserver_config.vm.box = "lucid64_local" | |
puppetserver_config.vm.host_name = "puppetmaster" | |
puppetserver_config.vm.forward_port("ssh", 22, 2222, :auto => true) | |
#puppetserver_config.vm.forward_port("http", 80, 8080) | |
puppetserver_config.vm.network "192.168.10.10" | |
# puppetserver_config.vm.boot_mode = :gui | |
puppetserver_config.vm.provision :shell, :path => "shellprovision/prepuppet.sh" | |
puppetserver_config.vm.provision :puppet do |puppet| |
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
// REFERENCE UNICODE TABLES: | |
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml | |
// http://www.tamasoft.co.jp/en/general-info/unicode.html | |
// | |
// TEST EDITOR: | |
// http://www.gethifi.com/tools/regex | |
// | |
// UNICODE RANGE : DESCRIPTION | |
// | |
// 3000-303F : punctuation |
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
# create server | |
cmd /c sc create SeleniumGrid binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" launch-hub " DisplayName= "Selenium Grid Server" | |
# create client | |
cmd /c sc create SeleniumGridClient binPath= "cmd /c ant -f \"C:\opt\selenium-grid-1.0.8\build.xml\" -Dport=4545 -Denvironment=*chrome launch-remote-control " DisplayName= "Selenium Grid Client" | |
# This doesn't work, want to create a tc7 server... sigh... | |
cmd /c sc create Tomcat binPath= "C:\opt\tomcat7\srvany.exe" start= "auto" DisplayName= "Apache Tomcat Server" | |
# Save this as tomcat-service.reg |
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 bash | |
# | |
# =================================== | |
# Experiments with the HBase REST API | |
# =================================== | |
# | |
# <http://hbase.apache.org/docs/r0.20.4/api/org/apache/hadoop/hbase/rest/package-summary.html> | |
# | |
# Usage: | |
# |
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
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
([一-龯]) | |
Regex for matching Hirgana or Katakana | |
([ぁ-んァ-ン]) | |
Regex for matching Non-Hirgana or Non-Katakana | |
([^ぁ-んァ-ン]) | |
Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
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
var phantom = require('phantom'), | |
vows = require('vows'), | |
assert = require('assert'); | |
// nesting tests inside phantom callback so we only | |
// have to create it once | |
phantom.create(function(ph) { | |
var get_page_result = function(url, fn, result) { | |
ph.createPage(function(page) { |
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
var EventEmitter = require("events").EventEmitter, | |
redis = require("redis"), | |
dateformat = require("dateformat"); | |
function population32(x) | |
{ | |
x -= ((x >> 1) & 0x55555555); | |
x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); | |
x = (((x >> 4) + x) & 0x0f0f0f0f); | |
x += (x >> 8); |
OlderNewer