Skip to content

Instantly share code, notes, and snippets.

View jason-s13r's full-sized avatar

Jason Schwarzenberger jason-s13r

View GitHub Profile
@jason-s13r
jason-s13r / brainfuck.js
Last active August 29, 2015 13:56
unfinshed brainfuck interpreter in js. Still need to do [ and ].
console.group('helloWorld');
var helloWorldScript = 'this is hello world: ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.';
var helloWorld = new BrainFuck(helloWorldScript);
console.log('script:', helloWorldScript);
console.log('validate:', helloWorld.validate());
console.log('execute:', helloWorld.execute());
console.groupEnd('helloWorld');
function BrainFuck(str, cells) {
@jason-s13r
jason-s13r / gist:9359839
Last active August 29, 2015 13:57
WIP: LOLcryption in BrainFuck. Cannot handle characters with a code less than 'a'. Will infinite loop in that case. If it isn't an [a-z] then it should just echo the character. Try it out at http://brainfuck.master5o1.com
,[
---------- ---------- ---------- ---------- ----------
---------- ---------- ---------- ---------- ------- a
[- b
[- c
[- d
[- e
[- f
[- g
[- h
var crypto = require('crypto');
var request = require('request');
module.exports = function BitNZ(username, apiKey, apiSecret) {
var self = this;
var hostname = 'https://bitnz.com';
var api = '/api/0';
var noop = function() {};
var sign = function(obj){
angular.module('BitNZ', []).factory('Api', ['$http', '$log', function ($http, $log) {
'use strict';
var api = {};
var host = 'https://bitnz.com/api/0';
var config = {
username: '',
key: '',
secret: ''
};
<!DOCTYPE html>
<html>
<head>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/hmac-sha256.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script>
<script src="libs/bitnz-angular/bitnz-angular.js"></script>
<script src="js/pretty-bitnz.js"></script>
<style>
</style>
</head>
Verifying that +master5o1 is my Bitcoin username. You can send me #bitcoin here: https://onename.io/master5o1
@jason-s13r
jason-s13r / WebSocketRpc.js
Last active August 29, 2015 14:11
WebSocket RPC
function WebSocketRpc(url, batchOperationsDisabled) {
'use strict';
var self = this;
var socket = null;
var queue = [];
var history = {};
var methods = {};
var noop = function () {};
var noopFactory = function () {
return noop;
@jason-s13r
jason-s13r / index.html
Last active August 29, 2015 14:16
Name Generator
<html>
<head></head>
<body>
<strong>Markov Team Name Generator</strong>
<br />
<button id="get-markov-name">Get Name</button>
<p>First table shows names generated by creating a first name starting with the most common first two letters, and a last name starting with the most common first two letters.</p>
<table border=1>
@jason-s13r
jason-s13r / index.html
Created February 28, 2015 10:18
Simpler Name Generator Thing
<html>
<head></head>
<body>
<strong>Markov Team Name Generator</strong><br />
<button id="get-markov-name">Get Name</button><br />
<strong>Generated Name:</strong>
<span id="generated-name">click Get Name to generate a name</span><br />
<textarea style="min-width:200px; min-height: 400px;" id="previous-names"></textarea><br />
konami(function(){
console.log('KONAMI!!!');
});
function konami(fn, match) {
var konamiCode = '3838404037393739666513';
var sequence = '';
match = match || konamiCode;
window.addEventListener('keyup', function(event){
sequence += event.keyCode;