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
public float[] calculateRank(Server server) { | |
float rank = 10.0f; | |
Jedis jedis = // REDACTED SERVER SPECIFIC | |
List<String> checks_json = // REDACTED SERVER SPECIFIC | |
App.pool.returnResource(jedis); | |
float good = 0; | |
float total = checks_json.size(); | |
for(String check : checks_json) { | |
Result res = gson.fromJson(check, Result.class); | |
if(res.result == true) |
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
## install.rb | |
file = File.open('install.list') | |
file.each do |line| | |
lib = line.split(' ') | |
puts "Installing #{lib}.." | |
`apt-get install #{lib.first} -y` | |
puts "Done!" | |
end | |
## install.list |
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
### Keybase proof | |
I hereby claim: | |
* I am wedtm on github. | |
* I am wedtm (https://keybase.io/wedtm) on keybase. | |
* I have a public key ASACDGOJPJhc3saZW9mIevMLRlcTjRFBK-4Az1jjANCE7wo | |
To claim this, I am signing this object: |
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 'socket' | |
require 'timeout' | |
class MCQuery | |
MAGIC_PREFIX = "\xFE\xFD" | |
PACKET_TYPE_CHALLENGE = "\x09" | |
PACKET_TYPE_QUERY = "\x00" | |
ID = "\x00\x00\x00\x00" | |
DEFAULTS = { | |
host: "localhost", |
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
# | |
# Tested on 1.9.2-p290, Written by Miles Smith (WedTM) | |
# | |
require 'socket' | |
class MCQuery | |
MAGIC_PREFIX = "\xFE\xFD" | |
PACKET_TYPE_CHALLENGE = "\x09" | |
PACKET_TYPE_QUERY = "\x00" |
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 compile_asset?(path) | |
# ignores any filename that begins with '_' (e.g. sass partials) | |
# all other css/js/sass/image files are processed | |
if File.basename(path) =~ /^[^_].*\.\w+$/ | |
puts "Compiling: #{path}" | |
true | |
else | |
puts "Ignoring: #{path}" | |
false | |
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
diff --git a/.travis.yml b/.travis.yml | |
index d9c0a57..c094c87 100644 | |
--- a/.travis.yml | |
+++ b/.travis.yml | |
@@ -4,6 +4,7 @@ rvm: | |
- ree | |
- 1.9.2 | |
- 1.9.3 | |
+ - 2.0.0 | |
- jruby-19mode |
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
upstream app { | |
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.app.com; | |
rewrite ^/(.*) http://app.com/$1 permanent; | |
} | |
server { |
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
MAX_THREADS = 30 | |
@current_threads = 0 | |
while (true) | |
if (@current_threads >= MAX_THREADS) | |
sleep 1 | |
next | |
end | |
Thread.new do |
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 Checks, Pusher, Servers, executeCheck, mongo, net, processCheck, pusher, r, redis, start, util, remaining, completed, failed, timedout, succeeded; | |
net = require('net'); | |
redis = require('redis'); | |
util = require('util'); | |
r = redis.createClient(6379, "<<<< REDACTED >>>>"); | |
mongo = require('mongoskin'); | |
Pusher = require('node-pusher'); | |
require('tamejs').register(); | |
pusher = new Pusher({ | |
appId: '<<<< REDACTED >>>>', |
NewerOlder