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/sh | |
download_page='http://links.powerbot.org/download' | |
referer='http://powerbot.org' | |
filename='RSBot.jar' | |
curl -GL -e $referer -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19" -o $filename $download_page | |
# Well you could also add the line to add the line for start the bot after download | |
# java -jar $filename |
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 removeEmpty = function(object) { | |
if (!_.isObject(object)) { | |
return; | |
} | |
_.keys(object).forEach(function(key) { | |
var localObj = object[key]; | |
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
echo '2-57/5 * * * * HA_TOKEN=OOOO HA_HOST=tik.tok.org python3 $HOME/temperature.py >> $HOME/temperature.log 2>&1' | crontab - |
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 Random = { | |
/** | |
* Numbers between ~( -2 to 2 ) | |
* http://stackoverflow.com/questions/75677/converting-a-uniform-distribution-to-a-normal-distribution | |
* http://c-faq.com/lib/gaussian.html | |
*/ | |
gaussian: function() { | |
var x1, x2, r; |
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
package main | |
import "fmt" | |
type Command interface { | |
Execute() string | |
} | |
type PingCommand struct{} | |
func (p *PingCommand) Execute() string { |
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 canvas = document.getElementById("container"); | |
var ctx = canvas.getContext("2d"); | |
// The line settings | |
ctx.lineWidth = 4; | |
ctx.lineJoin = ctx.lineCap = "round"; | |
var intervalSource = Rx.Observable.interval(2 * 1000, Rx.Scheduler.requestAnimationFrame); | |
var pauser = new Rx.Subject(); |
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
load('api_config.js'); | |
load('api_events.js'); | |
load('api_gpio.js'); | |
load('api_mqtt.js'); | |
load('api_net.js'); | |
load('api_sys.js'); | |
load('api_esp8266.js'); | |
load('api_dht.js'); | |
load('api_timer.js'); |
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 t, { | |
array, type, string, number, mixed, boolean, union, | |
null as Null, undefined as Undefined, Type, literal, | |
success, failure, | |
} from 'io-ts'; | |
import { ThrowReporter } from 'io-ts/lib/ThrowReporter' | |
import { PathReporter } from 'io-ts/lib/PathReporter' | |
import { reporter } from 'io-ts-reporters'; |
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 aws = require('aws-sdk'); | |
var util = require('util'); | |
var SQS = new aws.SQS({ | |
accessKeyId: 'xxxx', | |
secretAccessKey: 'xxx', | |
region: 'xxx', | |
sslEnabled: false, | |
paramValidation: true, | |
convertResponseTypes: 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
// Takes an SVG element as target | |
function svg2png(target) { | |
// Flatten CSS styles into the SVG | |
for (i = 0; i < target.childNodes.length; i++) { | |
child = target.childNodes[i]; | |
child.style.cssText = window.getComputedStyle(child).cssText; | |
} | |
var box = target.viewBox.baseVal; |
NewerOlder