Skip to content

Instantly share code, notes, and snippets.

View wedtm's full-sized avatar

Miles Smith wedtm

  • Vimae Development, LLC.
  • Tampa, FL
View GitHub Profile
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)
## 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
### 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:
@wedtm
wedtm / mcquery.rb
Created February 29, 2012 11:04
MCQuery - Minecraft Query Implementation in Ruby
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",
@wedtm
wedtm / gist:1906478
Created February 25, 2012 04:35
Ruby based Minecraft Vanilla Query Check
#
# 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"
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
@wedtm
wedtm / gist:5285611
Last active December 15, 2015 15:59
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
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 {
MAX_THREADS = 30
@current_threads = 0
while (true)
if (@current_threads >= MAX_THREADS)
sleep 1
next
end
Thread.new do
@wedtm
wedtm / frankie.src.js
Created January 7, 2012 07:21
Frankie - MCSL Checking Drone
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 >>>>',