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
(function(){var m=m||{},g=m,a={id:"imports"};g.opts=g.opts||{};g.d={l:{},n:{},a:{},w:{}};g.z="undefined"!==typeof GLOBAL&&GLOBAL.global&&GLOBAL.process&&GLOBAL.process.env&&GLOBAL.process.pid&&GLOBAL.process.execPath?function(){global.node=g.node=!0;module.exports=function(b,e,d){var c=a.r(b,e,d);c.s=g.y||(module.parent||{}).filename;a.e(a.d(c.d,c.s,{}),function(b,e){c.a[b]=a.n(e=require(g.y=e))?void 0:e});return c.i(c.a)}}:function(){var b=window;g.page=!0;b.root=g;b.console=b.console||{log:function(a){return a}}; | |
location.local="file:"===location.protocol?"http:":"";b.__dirname="";b.module={exports:b.exports={}};a.l=function(a,b){var c="script",f=document.createElement(c);module.sync=null!==f.onload&&f.readyState?1:0;var h=2166136261,g=a.length,k=b,q=/=\?/,r=window.setTimeout,n,m,p=function(a){document.body&&(a=a||n)&&f&&document.body[a]?document.body[m=a](f):r(p,0)};if(q.test(a)){for(;g--;)h=16777619*h^a.charCodeAt(g);window[c+=0>h?-h:h]=function(){k.apply(k,arguments);delete window[c]};a=a.replace(q,"="+ |
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=require('theory') | |
('is', function(a){ | |
return function(what){ | |
return { | |
binary: a.bi.is(what) | |
,number: a.num.is(what) | |
,text: a.text.is(what) | |
,list: a.list.is(what) | |
,object: a.obj.is(what) | |
,func: a.fns.is(what) |
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 allDone = function(done){ // takes a callback that will be called as callback(errors, values) when all async parallel operations are finished. | |
var context = {task: {}, data: {}}; | |
context.end = function(e,v){ return done(e,v), done = function(){} }; // this can always be called if you want to terminate early, like because an error. | |
context.add = function(fn, id){ // if the async operation you are doing replies with standard fn(err, value) then just pass in a string ID, else your own callback and ID. | |
context.task[id = (typeof fn == 'string')? fn : id] = false; | |
var next = function(err, val){ | |
context.task[id] = true; // good, we're done with this one! | |
if(err){ (context.err = context.err || {})[id] = err } // record errors. | |
context.data[id] = val; // record the values. | |
for(var i in c.task){ if(c.task.hasOwnProperty(i)){ // loop over the async task checker |
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
<html> | |
<body> | |
<script src="http://rawgit.com/amark/gun/master/gun.js"></script> | |
<script> | |
localStorage.clear(); // reset the data! | |
Gun.chain.joinTeam = function(team){ // extends gun to make bidirectional pointing easy! | |
var member = this; | |
member.val(function(theMember){ | |
team.set(theMember); // link the member to the team. | |
}); |
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
<html> | |
<body> | |
<script src="http://rawgit.com/amark/gun/master/gun.js"></script> | |
<script> | |
localStorage.clear(); | |
var gun = Gun(); | |
// define the snake team! | |
var snakes = gun.get('team/snakes').put({team: "snakes"}); | |
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
function importGUN3 (data, options){ | |
options = options || {}; | |
options.prefix = 'gun/'; | |
if(options.arrays !== false){ | |
options.arrays = true; | |
data = array2object(data); | |
} | |
var drift = options.state || Gun.time.now(); | |
var ctx = {}, at = {}; | |
Gun.ify(data, function(env, cb, map){ |
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
/** | |
* Created by Paul on 10/1/2016. | |
*/ | |
var fs = require('fs'); | |
var nodePath = require('path'); | |
var banner = "//console.log(\"!!!!!!!!!!!!!!!! WARNING THIS IS GUN 0.5 !!!!!!!!!!!!!!!!!!!!!!\");\n"; | |
var polyCover = "\n\t/* UNBUILD */\n"; | |
var immediateStart = "\n;(function(){\n"; | |
var reqStart = "\n;require(function(module){\n"; |
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
<div id="be"> | |
<div id="view"></div> | |
<video id="video" style="display: none; height:300px;width:320px" autoplay="true"></video> | |
<canvas id="canvas" style="display: none; height:240px; width:320px"></canvas> | |
<textarea id="debug" style="height:240px;width:420px;"></textarea> | |
<div id="audio"></div> | |
</div> | |
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> | |
<script src="gun.js"></script> | |
<script> |
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
<h1>PM</h1> | |
<form id="sign"> | |
<input id="alias" placeholder="username"> | |
<input id="pass" type="password" placeholder="passphrase"> | |
<input id="in" type="submit" value="sign in"> | |
<input id="up" type="button" value="sign up"> | |
</form> | |
<ul id="chats"></ul> |
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
<html><body> | |
<style> | |
html, body { | |
background: rgb(245, 245, 245); | |
margin: 0; | |
padding: 0; | |
} | |
div { | |
position: relative; | |
overflow: hidden; |
OlderNewer