Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@rhalff
rhalff / Description.md
Created February 8, 2018 09:12 — forked from juanje/Description.md
Limit Chrome from eating all the memory and CPU

I was tired of Chrome eating all my laptop resources so I decided to put some limit to it with cgroup.

As I was using Ubuntu 12.04 with support for cgroup, I installed the package cgroup-bin and add the following group to the file /etc/cgconfig.conf:

group browsers {
    cpu {
#       Set the relative share of CPU resources equal to 25%
        cpu.shares = "256";
 }
@rhalff
rhalff / webpack.nginx.conf
Created January 22, 2018 22:32 — forked from SiZapPaaiGwat/webpack.nginx.conf
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
// d8 --expose-gc --allow-natives-syntax --track-retaining-path weak-value-retaining-path.js
class SomeKey {
}
class Metadata {
constructor() {
this.large = new LargeObject();
}
}
@rhalff
rhalff / migrate-to-lerna.sh
Last active October 3, 2018 13:04 — forked from JamieMason/migrate-to-lerna.sh
Bash script to migrate multiple projects into one Lerna monorepo (https://lernajs.io)
#!/usr/bin/env bash
set -x
shopt -s extglob dotglob
TEMP_DIR=tmp
USERNAME=psichi
REPOS=(chix)
function clone_repo () {
@rhalff
rhalff / es6-compose.md
Created October 15, 2017 22:11 — forked from JamieMason/es6-compose.md
ES6 JavaScript compose function

ES6 JavaScript Compose Function

Definition

const compose = (...fns) =>
  fns.reverse().reduce((prevFn, nextFn) =>
    value => nextFn(prevFn(value)),
    value => value
 );
@rhalff
rhalff / cordova-plugin-guide.md
Created June 9, 2017 11:37 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

@rhalff
rhalff / a2dp_sink_ubuntu_linux.md
Created January 28, 2017 20:01 — forked from joergschiller/a2dp_sink_ubuntu_linux.md
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

@rhalff
rhalff / gh-pages-deploy.md
Created September 25, 2016 14:14 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

(function(){
"use strict";
Array.prototype.clean = function() {
for (var i = 0; i < this.length; i++) {
if (this[i] == null) {
this.splice(i, 1);
i--;
}
}
@rhalff
rhalff / arch_gpu_passthrough.MD
Created July 25, 2016 19:39 — forked from heppu/arch_gpu_passthrough.MD
Arch GPU passthrough

Install rpmextract

sudo pacman -Suy rpmextract

Get lates edk2.git-ovmf-x64

wget https://www.kraxel.org/repos/jenkins/edk2/edk2.git-ovmf-x64-XXXXXX.noarch.rpm