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
#!/usr/bin/env ruby | |
fh = File.new('rules3.csv', 'r') | |
ranges = [] | |
range_counts = {} | |
while row = fh.gets | |
row.chomp! | |
company_id, rule_count = row.split(',') | |
rule_count = rule_count.to_i |
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
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init {:file "/var/log/riemann/riemann.log"}) | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "0.0.0.0"] | |
(tcp-server {:host host}) | |
(udp-server {:host host}) |
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
<?php | |
class Foo | |
{ | |
private $bar; | |
public $car; | |
public function __construct($arg1 = 'bar', $arg2 = 'car') | |
{ | |
$this->bar = $arg1; |
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 arePointsNear(checkPoint, centerPoint, km) { | |
var ky = 40000 / 360; | |
var kx = Math.cos(Math.PI * centerPoint.lat / 180.0) * ky; | |
var dx = Math.abs(centerPoint.lng - checkPoint.lng) * kx; | |
var dy = Math.abs(centerPoint.lat - checkPoint.lat) * ky; | |
return Math.sqrt(dx * dx + dy * dy) <= km; | |
} |
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
$issueAggregates = array( | |
'totalCount' => 0, | |
'totalHours' => 0, | |
'bugCount' => 0, | |
'bugHours' => 0 | |
); | |
foreach ($columns as $column) { | |
$items[$column] = $this->jira_model->getRoadmapTasks($column); |
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
root@demo1:~/maria# pwd | |
/root/maria | |
root@demo1:~/maria# tree | |
. | |
├── etc | |
│ └── mysql | |
└── var | |
└── lib | |
└── mysql |
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 gen_keys(start, offset, count) | |
[start] + (1..count).to_a.map {|idx| start+offset*idx} | |
end | |
seen = {} | |
start_pos = (1..16).to_a | |
test_count = 1_000_000 | |
loop do | |
puts "starting positions #{start_pos.inspect}" |
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
brew doctor | |
brew tap homebrew/dupes | |
brew tap homebrew/versions | |
brew tap josegonzalez/php | |
brew install gearman | |
brew install php53 php53-crypto php53-gearman php53-http php53-mcrypt php53-imagick php53-memcache \ | |
php53-memcached php53-mongo php53-sphinx php53-uuid php53-xdebug php53-yaml |
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
[mysql] | |
# CLIENT # | |
port = 3306 | |
socket = /usr/local/var/mysql/mysql.sock | |
[mysqld] | |
# GENERAL # | |
user = mysql |
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
dateParts = function(seconds) | |
{ | |
month = 86400 * 30; | |
week = 86400 * 7; | |
day = 86400; | |
hour = 3600; | |
minute = 60; | |
// results | |
months = 0; |