Skip to content

Instantly share code, notes, and snippets.

View fractalf's full-sized avatar
🤠
Always coding..

Alf Marius fractalf

🤠
Always coding..
View GitHub Profile
@fractalf
fractalf / Dockerfile
Last active October 7, 2023 08:48
Building VST3 Geonkick
FROM debian:12.1
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y --no-install-recommends \
git \
ca-certificates
RUN git clone https://github.com/Geonkick-Synthesizer/geonkick.git
RUN mkdir /geonkick/build
WORKDIR /geonkick/build
RUN git clone --recursive https://github.com/steinbergmedia/vst3sdk.git
@fractalf
fractalf / cheatsheet.md
Last active October 12, 2017 12:03
Cheatsheet

Fractalf's cheatsheet

Handy stuff

grep

  • grep -B 2 -A 3 foo bar Show 2 lines before and 3 lines after grepping for foo in bar
  • grep --color=always foo bar | less -r show foo in colors also when piping to less
  • grep -E "(foo|bar)" * find files containing foo or bar (Note: file will be displayed twice)

git

  • git diff -w ignore whitespace when comparing line
@fractalf
fractalf / dir.js
Last active July 26, 2016 13:15
Hack! sshfs and babel watch don't work so we insert a delay
// https://github.com/babel/babel/blob/master/packages/babel-cli/src/babel/dir.js
// https://phabricator.babeljs.io/T7411
"use strict";
var _stringify = require("babel-runtime/core-js/json/stringify");
var _stringify2 = _interopRequireDefault(_stringify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@fractalf
fractalf / tmpl-loader.js
Last active June 15, 2016 06:22
A webpack loader for "JavaScript Templates" by blueimp that compiles templates to js
/*
tmpl-loader.js
A webpack loader for "JavaScript Templates" by blueimp that compiles templates to js
https://github.com/blueimp/JavaScript-Templates#compiled-templates
This code is based on compile.js
Usage (webpack.config.js):
module.exports = {
module: {
loaders: [
@fractalf
fractalf / rec-func-promise.js
Created June 10, 2016 12:15
Javascript: Recursive functions and Promises/A+
/**
* Javascript Promises/A+ and recursive functions
* A simplified example
* Inspired by: https://kostasbariotis.com/node-js-recursion/
*
* Output:
* 1: async job simulation started
* 1: job done
* 2: async job simulation started
* 2: job done
@fractalf
fractalf / customHttpConnector.js
Last active January 20, 2020 13:52
Custom HttpConnector for elasticsearch-js. Usage: connect to server with https self signed certificate
var HttpConnector = require('elasticsearch/src/lib/connectors/http');
var inherits = require('util').inherits;
var qs = require('querystring');
var fs = require('fs');
function CustomHttpConnector(host, config) {
HttpConnector.call(this, host, config);
}
inherits(CustomHttpConnector, HttpConnector);