Skip to content

Instantly share code, notes, and snippets.

@yurikoex
yurikoex / pp.sh
Last active March 11, 2018 18:38
prettier for that pesky package.json you are always hacking on!
node -p "r=require;j='./package.json';p=r(j);r('fs').writeFileSync(j,JSON.stringify(p,null,'\t'));'😎'"
load('api_bitbang.js');
load('api_sys.js');
load('api_gpio.js');
let pin = 26;
let pixels = 60;
let len = pixels * 4;
let data = Sys.malloc(len);
for(let i = 0; i < len; i++) {
data[i] = 1;
@yurikoex
yurikoex / tyson.js
Created December 16, 2017 22:31
for tyson
import { Subject } from 'rxjs'
import { doWork } from './elsewhere'
export const monitor = filter => {
const subject = new Subject()
let isComplete = false
const monitor = () => {
if (isComplete) subject.complete()
else {
setTimeout(() => {
@yurikoex
yurikoex / rxjsHelper.js
Last active September 29, 2017 18:45
is this a good idea?
import { Subject } from 'rxjs'
/**
* next/error/complete should be functions like const myNext = fowarder => i => fowarder.next(doWorkBeforeFowarder(i))
* or do not pass them and automatically forward
*/
export const forwardObserver = ({
current,
forwarder = new Subject(),
next = void 0,
@yurikoex
yurikoex / instructions.md
Last active September 28, 2017 14:16
Getting Flash to work on NWJS 0.13+ on Windows 10

Download Flash

  • Install https://get.adobe.com/flashplayer with the PPAPI option
  • Navigate to C:\Windows\System32\Macromed\Flash
  • copy C:\Windows\System32\Macromed\Flash to .\PepperFlash\ in your nw folder

Modify NWJS Application

-Add the following code in your NWJS application

@yurikoex
yurikoex / setup.txt
Last active March 15, 2017 22:44
Setup JavaScript IDE on Pi 3
Install pi3 with noobs
https://www.raspberrypi.org/downloads/noobs/
Get NVM
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm
Add NVM to .bashrc
source ~/.nvm/nvm.sh
Install Cloud9
@yurikoex
yurikoex / readme.md
Created June 13, 2016 07:57 — forked from mauricecruz/readme.md
Zero Dark Matrix for Node Inspector
{
"id": "f2931ada-c89b-4a4c-8c6e-c42857a54ff6",
"name": "Bast Vector",
"mind": {
"name": "mind",
"baseStat": "strong(2)",
"currentStat": "strong(2)",
"wound": "none(6)",
"statHistory": [],
"fuelStat": {
@yurikoex
yurikoex / LICENSE.txt
Created October 9, 2015 16:31 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@yurikoex
yurikoex / gist:6891930
Last active December 25, 2015 00:59
Module pattern with inheritance. Mainly borrowed from TypeScript, but applied to John Resig's Simple Inheritance post: http://ejohn.org/blog/simple-javascript-inheritance. And Jubei always dies...
var Inherit = this.Inherit || function (newClass, classToInheritFrom) {
//copy properties
for (var property in classToInheritFrom)
{
if (classToInheritFrom.hasOwnProperty(property))
{
newClass[property] = classToInheritFrom[property];
}
}