Skip to content

Instantly share code, notes, and snippets.

@bnoden
bnoden / styles.less
Last active July 12, 2018 22:53
styles for Atom
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed and saved.
*
* Add your own CSS or Less to fully customize Atom.
*/
// style the background color of the tree view
@bnoden
bnoden / Car.js
Created May 22, 2018 02:22
Car Composition Tests
const { movement } = require('./props');
const { park, drive } = movement;
module.exports = {
movement: {
park,
drive
}
};
const curry = (func, arr = []) => (...args) =>
(nextArgs =>
nextArgs.length === func.length
? func(...nextArgs)
: curry(func, nextArgs))([...arr, ...args]);
const maintainPosition = () => {
let prevHeight = document.body.clientHeight;
setInterval((x, y) => {
if (prevHeight !== document.body.clientHeight) {
x = window.scrollX;
y = window.scrollY + document.body.clientHeight - prevHeight;
window.scrollTo(x, y);
}
}, 100);
};
@bnoden
bnoden / app.js
Created December 17, 2017 07:01
rnvp snack
import React, { Component } from 'react';
import { Dimensions, Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Video } from 'expo';
const btnPlay = require('./btn-play.png');
const btnPause = require('./btn-pause.png');
const demoVideo =
'firebasestorage.googleapis.com/v0/b/bn-wvid.appspot.com/o/TheBunnyMovie.mp4';
const demoToken =
'?alt=media&token=ac6c7062-076f-49eb-a747-acd232767daa';
@bnoden
bnoden / custom.js
Last active December 17, 2017 01:56
const entryHeader = document.querySelector('.entry-header');
const entryTitle = document.querySelector('.entry-title');
// entryHeader.style.display = 'none'; // To remove completely
entryTitle.innerText = 'What we do'; // Or whatever text you want
netstat -a -o -n
taskkill /F /PID <PID # for the port>
@bnoden
bnoden / gist:1b93cc2b0c2a588542b7ba91b3c56adb
Created March 7, 2017 11:39 — forked from wimleers/gist:750179
Wait for input by the user on stdin — the Qt way (and thus cross-platform).
QTextStream in(stdin);
forever {
QString line = in.readLine();
if (!line.isNull())
break;
}
(function bnoden() {
var body = document.querySelector('body'), cmLine = document.querySelectorAll('.CodeMirror-lines'),
cmVar = document.querySelectorAll('.cm-variable'), terminal = document.querySelectorAll('.CodeMirror-code'),
cmKey = document.querySelectorAll('.cm-keyword'), cmStr = document.querySelectorAll('.cm-string'),
c0de = document.querySelectorAll('code');
(function paint(){
body.style.background = '#CEF5D0'
for (var i = 0; i < cmVar.length; i++)
@bnoden
bnoden / quickBtn.js
Last active May 25, 2016 21:58
jquery quick button maker
$(document).ready(function(){
// Modify as needed to suit project
function quickBtn(txt, tag, cls){
this.txt = txt;
this.tag = '<'+tag+'>';
this.tagClose = '</'+tag+'>';
this.cls = cls;
};
quickBtn.prototype.make = function(element){