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 | |
# Based on https://www.unknowncheats.me/forum/php/98463-speedtest-real-fake-results-photoshop.html | |
## httpie (httpie.org - a modern curl replacement) and md5 are required | |
DOWN="999925" | |
UP="999794" | |
PING=1 | |
SERVER=3729 |
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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
<style> | |
body { | |
background: white; | |
text-align: center; | |
padding: 20px; | |
font-family: Georgia, serif; |
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
#! /usr/bin/ruby | |
# | |
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
user = 'YOUR GITHUB USERNAME' | |
pass = 'YOUR GITHUB PASSWORD' | |
repo = 'workmarket/application' |
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
module.exports = function(data) { | |
var _data = data | |
var filter = { | |
byType: function(query) { | |
// alter _data | |
return this | |
}, | |
byName: function(query) { | |
// alter _data |
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
"SELECT * FROM meetings WHERE meetingID = '1';" | |
"SELECT * FROM meetingAddress WHERE meetingID = '1';" | |
"SELECT * FROM districts WHERE districtID = '1';" |
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 _ = require('underscore') | |
var levers = [ | |
{ id: '1', val: 'one'}, | |
{ id: '2', val: 'two'}, | |
{ id: '3', val: 'three'}, | |
] | |
var ids = ['1', '3'] |
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
import java.util.*; | |
public class t { | |
public static void main(String[] args) { | |
String[] s = {"1", "2", "3"}; | |
String[] t = Arrays.copyOfRange(s, 1, 3); | |
System.out.println("Length of t: " + t.length); | |
System.out.println(t[0]); | |
System.out.println(t[1]); |
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
downloadReport: { | |
'default': function(reportFile, requestData, callback) { | |
var file = fs.createWriteStream(requestData.filename); | |
var downloadUrl = url.parse(requestData.reportingDownloadUrl); | |
var local = http.createClient(443, downloadUrl.host, secure=true); | |
requestData.headers['host'] = downloadUrl.host; | |
var request = local.request('GET', downloadUrl.pathname + downloadUrl.search, requestData.headers); | |
request.on('response', function (response) { |
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 String post(Service serviceName, Map<String, String> params) throws IOException { | |
StringBuffer sb = new StringBuffer(); | |
for (String key:params.keySet()) { | |
String value = params.get(key); | |
sb.append(key+"="+value+"&"); | |
} | |
String urlParameters = sb.substring(0,sb.length()-1); | |
URL url; |
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
sanitizeFile: function(reportFile, columnAdditions, rowDeletions, callback, retryCount) { | |
var rs = fs.createReadStream(reportFile, { encoding:'utf8' }) | |
, outputFile = path.dirname(reportFile) + "/" + path.basename(reportFile) + ".sanitized" | |
, ws = fs.createWriteStream(outputFile); | |
rs.on('data', function(data) { | |
var flushed = ws.write(data); | |
if (!flushed) { rs.pause(); } | |
}); | |