Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
space wizard

Stian Veum Møllersen mollerse

💭
space wizard
View GitHub Profile
View README.md

Gratulerer med dagen, Marco!

Her er kildekoden til kortet ditt. For å kjøre den:

git clone https://gist.github.com/a64218593a12809adb9d3814adf63e58.git
cd a64218593a12809adb9d3814adf63e58
npm i get-pixels ndarray ndarray-fill ndarray-scratch zeros
npx budo marco.js
@mollerse
mollerse / example.js
Last active Dec 6, 2019
Simple interface for controlling various parameters with MIDI and/or dat.gui
View example.js
import midiControl from "./midiControl.js";
const controls = midiControl("Launch Control MIDI 1");
function setProp(name, unit, v) {
document.documentElement.style.setProperty(name, `${v}${unit}`);
}
let setMarginXXS = setProp.bind(null, "--tv-margins-xxs", "px");
let setMarginXS = setProp.bind(null, "--tv-margins-xs", "px");
@mollerse
mollerse / README.md
Last active Dec 12, 2018
Intro to perlin-noise
View README.md

Install

npm install -S canvas-sketch canvas-sketch-util simplex-noise

Save the code from sketch.js to a local file.

Run

@mollerse
mollerse / puzzle.pl
Last active Oct 31, 2018
Prolog solution(ish) to 6th grade logic puzzle
View puzzle.pl
diff_known(X, Diff, Y):- Y is X + Diff.
abs_diff(X, Diff, Y):- Y is X + Diff ; Y is X - Diff.
older(X, Y):- X > Y.
drop_lie(Facts, Index, Truths):- nth0(Index, Facts, _, Truths).
% Prints program dropping a configuration of lies
print_program(L1, L2, L3):-
% Valid program:
@mollerse
mollerse / package.json
Last active Feb 22, 2018
Repro of stuff in node_modules/.bin disappearing with npm-ci
View package.json
{
"name": "npm-ci-repro",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "rm -rf node_modules package-lock.json && npm i && ls node_modules/.bin && npm ci && ls node_modules/.bin"
},
"keywords": [],
"license": "ISC",
@mollerse
mollerse / console-log.sublime-snippet
Created Mar 3, 2014
ST snippet for console.log('heia')
View console-log.sublime-snippet
<snippet>
<content><![CDATA[
console.log(${1:'heia'});
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>cl</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.js</scope>
</snippet>
@mollerse
mollerse / gulpfile-express.js
Last active Jan 29, 2020
Gulpfile for livereload + static server
View gulpfile-express.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
@mollerse
mollerse / spotify_notification.py
Created Aug 15, 2013
Pythonscript for track-change notifications in KDE
View spotify_notification.py
#!/usr/bin/env python
import dbus
import gobject
from dbus.mainloop.glib import DBusGMainLoop
import time
class SpotifyNotifier(object):
def __init__(self):
You can’t perform that action at this time.