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
window.randomly = () -> (Math.round(Math.random())-0.5) | |
Number::toRadians = () -> @*2*Math.PI/360 | |
class LocationHistory | |
constructor: (name = "Name", load = false, onUpdate) -> | |
if not navigator.geolocation | |
return "not supported" | |
@name = name | |
@times = [] | |
@locations = [] |
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
class String | |
{ | |
:reset => 0, | |
:bold => 1, | |
:dark => 2, | |
:underline => 4, | |
:blink => 5, | |
:negative => 7, | |
:black => 30, | |
:red => 31, |
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
# Author:: Lucas Carlson (mailto:[email protected]) | |
# Copyright:: Copyright (c) 2005 Lucas Carlson | |
# License:: LGPL | |
# These are extensions to the String class to provide convenience | |
# methods for the Classifier package. | |
class String | |
# Removes common punctuation symbols, returning a new string. | |
# E.g., |
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
#!/bin/bash | |
# echo $ | |
#This is good j | |
git diff --cached | grep -i "^\+[^#]*debugger" && | |
# git diff --cached --name-only --diff-filter=ACM | |
exit 1 | |
# Pre commit hook that prevents FORBIDDEN code from being commited. | |
# Add unwanted code to the FORBIDDEN array as necessary |
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
require 'nokogiri' | |
require 'open-uri' | |
require 'pry' | |
require 'net/http' | |
require 'net/https' | |
class UnclaimedProperty | |
attr_accessor :lname, :fname, :middle, :city | |
attr_reader :results, :more_results_than_shown | |
def initialize(options) |
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 fs = require('fs'); | |
var gulp = require('gulp'); | |
var runWintersmith = require('run-wintersmith'); | |
var s3 = require("gulp-s3"); | |
var options = { headers: {'Cache-Control': 'public'} } | |
gulp.task('default', function() { | |
console.log('`gulp deploy` to deploy') | |
}); |
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
namespace :static do | |
desc 'Generate static site in ./out/ directory' | |
task :generate do | |
Dir.mkdir 'out' unless File.exist? 'out' | |
Dir.chdir 'out' do | |
`wget -mnH http://localhost:3000/` | |
end | |
`rsync -ruv --exclude=.svn/ public/ out/` | |
end |
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
jQuery.get(document.location.href, function(html) { | |
itemprops = Array.prototype.slice.call(jQuery(html).find("[itemprop]")) | |
properties = itemprops.reduce(function(memo, curr) { | |
if (curr.tagName == "META") { | |
memo[curr.attributes.getNamedItem('itemprop').value] = curr.attributes.getNamedItem('content').value | |
} else { | |
memo[curr.attributes.getNamedItem('itemprop').value] = curr.innerText.trim(); | |
} | |
return memo; | |
}, {}) |
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 http = require('http'), | |
fs = require('fs'), | |
loadDomains, getTheTimeFromServerList, formatDateHeader; | |
loadDomains = new Promise(function (resolve, reject) { | |
var servers; | |
fs.readFile('hostnames.txt', 'utf8', function (err, data) { | |
if (err) { | |
reject('Unable to read hostnames.txt'); | |
} |
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
def self.high_outliers(column) | |
values = pluck(column) | |
q1 = DescriptiveStatistics::Stats.new(select{|d| d.send(column)<values.median }.map{ |d| d.send(column)}).median | |
q3 = DescriptiveStatistics::Stats.new(select{|d| d.send(column)>values.median }.map{ |d| d.send(column)}).median | |
iqr = q3-q1 | |
select { |d| d.send(column)>(q3 + 1.5 * iqr) } | |
end |
OlderNewer