Skip to content

Instantly share code, notes, and snippets.

@formula1
formula1 / docker-compose.yml
Last active March 3, 2017 03:25
selenium testing
version: "3"
services:
fileserver:
image: kyma/docker-nginx
command: nginx
volumes:
- "./:/var/www"
ports:
- "8080:80"
hub:
@formula1
formula1 / example.jsx
Created March 2, 2017 21:24
Simple React Server
module.exports = function(props){
return (
<html>
<head></head>
<body>
<h1>This is an example</h1>
<ul>{props.data.map(function(item){
return <li>{item.toString()}</li>;
})}</ul>
</body>
@formula1
formula1 / readme.md
Created February 7, 2017 19:28
Lesson CRUD

Purpose

Teach Developer how to implement simple reusable components and leaving complex database interdependency and logic to those database models.

Why is it good

There will be bugs in your code, there always is. However, there are many benefits to DRY principles.

  • Not reimplementing logic
  • Not rewriting everything
  • Not cutting and pasting
@formula1
formula1 / .babelrc
Created November 16, 2016 21:22
Inferno Basic Example
{
"presets" : [ "es2015" ],
"plugins" : [ "inferno" ]
}
module.exports = function(){
var date = Date.now();
while(Date.now() - date < 5000);
return 'ok';
}
var Transform = require('stream').Transform;
var ConfigUtil = require('./config.js');
var MatchUtil = require('./matcher.js');
var KeyEmitter;
module.exports = KeyEmitter = function(){
Transform.call(this,{
readableObjectMode : true,
writableObjectMode : true
});
@formula1
formula1 / matcher.js
Created March 4, 2016 09:39
matches a query
var matches,matchObj,matchArray,matchSequence,
allUniquePossible,matchString,matchNumber,curry,passesEnough,equal,not;
module.exports.matches = matches = function(obj,tester){
var tt = typeof tester;
if (tt !== 'object') return equal(obj,tester);
if ('is' in tester){
return tester.is;
@formula1
formula1 / RegeneratableOptionParser.js
Created January 25, 2016 10:37
__init__ to index
// Would REALLY Like to switch over to commander
var RegeneratableOptionParser;
// import optparse
var optparse = require('./optparse');
module.exports = RegeneratableOptionParser = function(optparse){
self.__regeneratable_options = {}
optparse.OptionParser.__init__(self)
@formula1
formula1 / db.js
Last active January 25, 2016 05:21 — forked from nsuan/announce.php
Bitstorm Tracker
var fs = require('fs');
/*
* Yeah, this is the database engine. It's pretty bad, uses files to store peers.
* Should be easy to rewrite to use SQL instead.
*
* Yes, sometimes collisions may occur and screw the DB over. It might or might not
* recover by itself.
*/
var DB;
@formula1
formula1 / .gitignore
Last active October 15, 2015 17:58
Boiler Plate
/node_modules