Skip to content

Instantly share code, notes, and snippets.

View mappum's full-sized avatar
⛓️

Matt Bell mappum

⛓️
View GitHub Profile
@mappum
mappum / gist:19b5f12edd001b33a72f
Last active August 29, 2015 14:03
Type-checking annotation in vanilla Javascript
// It's possible to add your own quasi language constructs in JS using comments and Function#toString.
// (Doesn't survive minification)
// (You might need to modularize the execution of the annotations)
function checkType(f) {
return function(a) {
var type = f.toString().match(/\/\/(.*)\n/)[1].trim();
if(type !== typeof(a)) throw new Error('Invalid type');
return f(a);
}
@mappum
mappum / Makefile
Last active August 29, 2015 14:16 — forked from jbenet/Makefile
vmname="PXE Booter"
iso=/ipfs/QmdTmSQtCz9D6vt2AbvQkYo3edFcTYoU7FDmDD7bPWDccA/ipfs.iso
define notfound
$(iso) not found
make sure the daemon is running and mounted:
ipfs daemon &
ipfs mount
endef
export notfound
Bot is initialized. HEAD: 192b96a98368f547dce6855800a955bd72554136
/home/bot/botwillacceptanything/voting.js:101
var voteFileName = 'https://raw.githubusercontent.com/' + PR.head.repo.own
^
ReferenceError: PR is not defined
at handlePR (/home/bot/botwillacceptanything/voting.js:101:63)
at Array.forEach (native)
at /home/bot/botwillacceptanything/main.js:85:9
at /home/bot/botwillacceptanything/node_modules/github/api/v3.0.0/pullRequests.js:64:17
at IncomingMessage.<anonymous> (/home/bot/botwillacceptanything/node_modules/github/index.js:782:21)
/*
* Execute with node.js, and pass the input via stdin, like so:
* node main.js < input.txt
*/
var MESSAGE = 'HACKERCUP';
/**
* The entry point, reads a number n then n datasets from stdin
* and passes them into run()
/*
* Execute with node.js, and pass the input via stdin, like so:
* node main.js < input.txt
*/
/**
* The entry point, reads a number n then n datasets from stdin
* and passes them into run()
*/
function main() {
/*
* Put the input in a file called input.txt
* This program outputs to stdout
*/
import org.encog.Encog;
import org.encog.engine.network.activation.ActivationBiPolar;
import org.encog.engine.network.activation.ActivationSigmoid;
import org.encog.mathutil.randomize.BasicRandomizer;
import org.encog.mathutil.randomize.ConsistentRandomizer;
20
274467416870917042 7270184 3005711 7759177 8197657 803826746 672879876 877174079 68314903
1708396388 999999 12347 9699690 9748872 727477719 669281518 799407527 906645153
739825879172045328 2683878 7208112 2912862 8898138 631358954 451401022 51028288 625542185
1555193042 9999991 1 9999991 9999989 259999767 19999980 239999737 679999252
982749972374309079 999999 12347 9699690 9748872 698378649 601383688 389954903 155982009
967702028973969107 1 10000000 10000000 10000000 840000001 670000000 40000001 19999998
1585081851 759324 967048 10000000 9999999 610000001 740000000 289999972 979999902
918495108443110920 9999991 1 9999991 9999989 849999236 589999466 309999660 169999814
54341206 9999909 9999991 9999949 9999991 689996482 829995765 749999326 389999649
Minecraft.BetaClient = function(args) {
if(Minecraft.ENVIRONMENT == 'node') {
if(typeof Minecraft.node.net == 'undefined') Minecraft.node.net = require('net');
this.host = args.host;
this.port = args.port || 25565;
this.username = args.username || 'Player';
this.status = 0;
if(typeof args.onLogin == 'function') this.onLogin = args.onLogin;
>> 02000d004d00690073007400650072004d00450052004b004c00450059
{ id: 2,
data:
[ { name: 'connectionHash',
type: 'string',
value: '248bc7153a0c9fe6' } ] }
>> 0100000017000d004d00690073007400650072004d00450052004b004c00450059000000000000000000000000000000000000
(function(Minecraft) {
/** @constructor */
Minecraft.Client = function(args) {
if(Minecraft.ENVIRONMENT == 'node') {
if(typeof Minecraft.node.net == 'undefined') Minecraft.node.net = require('net');
if(typeof Minecraft.node.http == 'undefined') Minecraft.node.http = require('http');
if(typeof Minecraft.node.https == 'undefined') Minecraft.node.https = require('https');
if(typeof Minecraft.node.querystring == 'undefined') Minecraft.node.querystring = require('querystring');
this.host = args.host;