Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Schwarzenberger jason-s13r

View GitHub Profile
@jason-s13r
jason-s13r / brainfuck.js
Last active Aug 29, 2015
unfinshed brainfuck interpreter in js. Still need to do [ and ].
View brainfuck.js
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 Aug 29, 2015
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
View gist:9359839
,[
---------- ---------- ---------- ---------- ----------
---------- ---------- ---------- ---------- ------- a
[- b
[- c
[- d
[- e
[- f
[- g
[- h
View BitNZ.js
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){
View BitNZService.js
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: ''
};
View index.html
<!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>
View gist:169489838b9e5ee0d100
Verifying that +master5o1 is my Bitcoin username. You can send me #bitcoin here: https://onename.io/master5o1
View WebSocketRpc.js
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
Created Feb 28, 2015
Simpler Name Generator Thing
View index.html
<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 />
@jason-s13r
jason-s13r / index.html
Last active Aug 29, 2015
Name Generator
View index.html
<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>
View konami.js
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;