Skip to content

Instantly share code, notes, and snippets.

View towski's full-sized avatar

towski towski

  • San Francisco, California
View GitHub Profile
8.470001 = (MATCH) sum of:
5.2308245 = (MATCH) max of:
5.2308245 = (MATCH) sum of:
0.50882924 = (MATCH) weight(title_text_ngram:but in 24457), product of:
0.051065523 = queryWeight(title_text_ngram:but), product of:
5.7528577 = idf(docFreq=1188, maxDocs=137823)
0.008876549 = queryNorm
9.964242 = (MATCH) fieldWeight(title_text_ngram:but in 24457), product of:
1.7320508 = tf(termFreq(title_text_ngram:but)=3)
5.7528577 = idf(docFreq=1188, maxDocs=137823)
<fieldType name="tag" class="solr.TextField">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
info: Welcome to Nodejitsu towski
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn:
warn: Your package.json file is missing required fields:
warn:
warn: scripts.start
warn:
warn: Prompting user for required fields.
warn: Press ^C at any time to quit.
@towski
towski / gist:5032770
Created February 25, 2013 20:02
sendgrid removing blocks
curl "https://sendgrid.com/api/unsubscribes.delete.json?api_user=username&api_key=password&email=devmessages@kongregate.com"
this.addFutureAction('check username', function($window, $document, done) {
console.log($window.active_user.username())
expect($window.active_user.username()).toBe("Guest")
done()
})
it('should set active_user to Guest', function() {
browser().navigateTo('/games')
var future = this.addFutureAction('browser href', function($window, $document, done) {
done(null, $window.active_user.username())
})
expect(future).toBe('Guest')
});
require 'unicorn'
require '../channels/lib/channel'
require 'kgio'
require 'fcntl'
require 'ruby-debug'
require 'net/http'
require 'benchmark'
include Unicorn::SocketHelper
CRLF = "\r\n"
@towski
towski / socket_ipc.rb
Created January 25, 2014 07:58
communicate between child processes and a master process like unicorn does
require 'unicorn/socket_helper'
require '../channels/lib/channel'
require 'kgio'
require 'fcntl'
require 'ruby-debug'
require 'net/http'
require 'benchmark'
include Unicorn::SocketHelper
CRLF = "\r\n"
@towski
towski / jquery.js
Last active August 29, 2015 13:56
jquery lite
function query(xpath, callback){
var results = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
for ( var i=0 ; i < results.snapshotLength; i++ ) {
if(callback){
callback(results.snapshotItem(i))
}
}
}
@towski
towski / android.rb
Last active August 29, 2015 13:56
build a jar
require 'ruboto'
ANDROID_HOME = ENV["ANDROID_HOME"]
android_jar = Dir["#{ANDROID_HOME.gsub("\\", '/')}/platforms/*/android.jar"][0]
android_jar.gsub!(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
class_path = ['.', "#{Ruboto::ASSETS}/libs/dx.jar","../libs/jruby-complete-1.7.10.jar", "../libs/mapdb.jar"].join(File::PATH_SEPARATOR).gsub(File::SEPARATOR, File::ALT_SEPARATOR || File::SEPARATOR)
cmd = "javac -source 1.6 -target 1.6 -cp #{class_path} -bootclasspath #{android_jar} -d . org/jruby/ext/dbm/*.java"
puts cmd
system(cmd)
`jar cvfe dbm.jar RubyDBM org/jruby/ext/dbm/*.class`