Skip to content

Instantly share code, notes, and snippets.

View nervetattoo's full-sized avatar

Raymond Julin nervetattoo

View GitHub Profile
@nervetattoo
nervetattoo / machine.js
Created April 16, 2021 09:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nervetattoo
nervetattoo / .hyper.js
Created December 19, 2016 12:03
hyperjs
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
#include "neopixel.h"
#define PIXEL_COUNT 29
#define PIXEL_PIN D2
#define PIXEL_TYPE WS2812B
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
int pos = -1;
@nervetattoo
nervetattoo / main.cpp
Last active October 30, 2016 13:58
Neopixel
#include "neopixel.h"
#define PIXEL_COUNT 29
#define PIXEL_PIN D2
#define PIXEL_TYPE WS2812B
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
void setup() {
strip.begin();
strip.show();
@nervetattoo
nervetattoo / Cat.js
Last active June 7, 2016 12:46
HOC Api inspired by refetch and recompose for simply assigning api data as props with "middleware" for authorization
import 'withApi' from './withApi.js'
const Cat = ({cat}) => <span>{cat.name} says {cat.purr}</span>
const enhance = withApi(props => ({
cat: `/api/cat/${props.id}`
}))
export default enhance(Cat)
@nervetattoo
nervetattoo / its-karakterer.js
Last active May 14, 2016 10:38
its-karakterer
// ==UserScript==
// @name its-karakterpoeng
// @namespace http://your.homepage/
// @version 0.8
// @description enter something useful
// @author You
// @match http*://hfk.itslearning.com/*
// @grant unsafeWindow
// @run-at context-menu
// ==/UserScript==
@nervetattoo
nervetattoo / promiseGate.js
Created June 9, 2015 11:38
Naming things?
function promiseGate(test) {
return function promiseGateResolver(value) {
return test(value).then(function(passedTest) {
if (!passedTest) throw new Error(test.name + ' failed');
return value;
})
}
};
function checkLength(file) {
@nervetattoo
nervetattoo / the-designer-is-dead-long-live-design
Last active August 29, 2015 14:21
The designer is dead, long live design
# The designer is dead, long live design
Design is a hotter subject than ever before. Apple is the most successful company in history, fueled by design, and the subsequent "design thinking" philosophy.
The concept of "design" is a far too important thing to be left to a designer. The designer is dead.
Long live design.
Design is a misunderstood practice, and one that I misunderstood for a long time myself. Being a developer – in itself a misunderstood practice for most as well – I long thought that we needed designers to design the stuff we were building. I expected upon the poor designers to produce blueprints for what we were building.
We often see clients reach out to us to buy a UX revamp, or some design touches, on their applications, websites or other visual properties.
Many think that the visual expression designed by the previous designer 5 years back is a replaceable skin with few ties into the application, or anything deeper.
@nervetattoo
nervetattoo / html
Created March 13, 2015 09:51
booster-bem
<section class="feed">
<div class="feed__item">
<div class="feed__item__image">
<img src="https://pbs.twimg.com/profile_images/378800000703912809/95cb11a8f7c2832b5de07055e3ff66b2.png">
</div>
<div class="feed__item__content">
<h2>Marius Hauken</h2>
<p>Naming CSS-classes sucks, but it's worth doing properly and think a lot about!</p>
</div>
<time class="feed__item__desc">03.03</time>
@nervetattoo
nervetattoo / async-auto.js
Last active December 10, 2016 09:42
promises-promises-promises
async.auto({
get_data: function(callback){
console.log('in get_data');
// async code to get some data
callback(null, 'data', 'converted to array');
},
make_folder: function(callback){
console.log('in make_folder');
// async code to create a directory to store a file in
// this is run at the same time as getting the data