View binaryUtil.js
var Util = {
toBinary: function(input) {
var result = "";
for (var i = 0; i < input.length; i++) {
var bin = input[i].charCodeAt().toString(2);
result += Array(8 - bin.length + 1).join("0") + bin;
}
return result;
},
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

View Google Analytics.js Outbound Link Tracking.js
View gist:9dde25f66a8adeae72f36eee5c712271
assertEqual: function(actual, expected) {
// Uses TraceKit to get stacktrace of caller,
// it looks for the line number of the first anonymous eval
// Stack traces are pretty nasty and not standardized yet
// so this is not as elegant as one might hope.
// Safari doesn't even give line numbers for anonymous evals,
// so they can go sit in the dunce corner today.
// This returns 0 if not found, which will mean that all
// the assertion failures are shown on the first line.
var getLineNum = function(stacktrace) {
View tcpick-mac-install.sh
#!/bin/bash
mkdir temp
cd temp
wget http://downloads.sourceforge.net/project/tcpick/tcpick/0.2.1/tcpick-0.2.1.tar.gz
tar zxvf tcpick-0.2.1.tar.gz
cd tcpick-0.2.1
CFLAGS="-m32 --std=c89" ./configure
echo "char *lookup();" >> src/lookup.h
make
sudo make install
View tcpick-mac-install.sh
#!/bin/bash
mkdir temp
cd temp
wget http://downloads.sourceforge.net/project/tcpick/tcpick/0.2.1/tcpick-0.2.1.tar.gz
tar zxvf tcpick-0.2.1.tar.gz
cd tcpick-0.2.1
CFLAGS="-m32" ./configure
echo "char *lookup();" >> src/lookup.h
make
sudo make install
View harsh.md

Wanted to withhold this harsher criticism from this comment: nolanlawson / ember-pouch / pull / 30 #issuecomment-72339191 but wanted to save it, and if someone searches google for "PouchDB security" they can find my more honest opinion:

"Concerned about the fact that you would remove documentation about security on the basis that you don't quite understand it, and not take the initiative to go and learn about it. It would be foolish to assume PouchDB currently has good security if a maintainer doesn't know what CSP is and doesn't take initiative to learn about it."

View inverse-xml-color-strings.js
// inverseA is the inverse function from this page but it only returns the newColor: http://www.webmasterorbit.com/rgb-hex-code.html
var text, node;
[].slice.call(document.getElementsByTagName('string'))
.forEach(function(node){
text = node.innerText;
if ( text.indexOf('#') === 0 ) {
node.innerText = '#' + inverseA(text.substring(1, 7) )
}
})
View ember-pouchdb-differences.md

I figured I would just write this gist in case anybody searches is.

taras/Ember-PouchDB has a more unique api, but I think it passes the ember-data test suite..

nolanlawson/ember-pouch simply makes the ember-data api work with pouch through relational-pouch.

Which one is better? I'm really not sure, but with nolanlawson/ember-pouch, nolan has made the regular ember-data api work with pouch in a pretty clean way. All you do is setup the adapter.

Please comment with more info as I haven't gotten to try out both plugins, I don't know jack lanterns

View hourly_wage_calculator.rb
#!/usr/bin/env ruby
loop {
puts "reasonable bay area salary:" #70000
baySalary = baySalary || 70000
baySalary = gets.to_i || baySalary || 70000
puts "reasonable monthly cost for room in bay area:" #750
bayRent = bayRent || 740
bayRent = gets.to_i || bayRent
puts "reasonable monthly cost for room in Eugene: (default 370)"