Skip to content

Instantly share code, notes, and snippets.

View chp-io's full-sized avatar

Christopher Pelloux chp-io

View GitHub Profile
@chp-io
chp-io / .gitignore
Created October 11, 2013 15:10 — forked from bmchild/.gitignore
# Directories #
/build/
/bin/
target/
# OS Files #
.DS_Store
*.class
@chp-io
chp-io / javascript multiline string
Created June 16, 2014 14:07
Multiline string in pure Javascript
// Found on http://stackoverflow.com/a/5571069/3718694
function mlString(f) {
return f.toString().
replace(/^[^\/]+\/\*!?/, '').
replace(/\*\/[^\/]+$/, '');
}
var tennysonQuote = mlString(function() {/*!
Theirs not to make reply,
@chp-io
chp-io / crc32.js
Created March 30, 2015 05:01
crc32
// from https://github.com/gildas-lormeau/zip.js/blob/master/WebContent/zip.js
function Crc32() {
this.crc = -1;
}
Crc32.prototype.append = function append(data) {
var crc = this.crc | 0, table = this.table;
for (var offset = 0, len = data.length | 0; offset < len; offset++)
crc = (crc >>> 8) ^ table[(crc ^ data[offset]) & 0xFF];
this.crc = crc;
@chp-io
chp-io / opengl-transparency-demo.cpp
Created February 17, 2016 11:38 — forked from wilkie/opengl-transparency-demo.cpp
Rendering directly to a composited window in vista+ with opengl.
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <windowsx.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <dwmapi.h>
#pragma comment (lib, "opengl32.lib")

The current kernel/drivers of Fedora 24 do not support the Wifi chip used on my Mac Book Pro. Proprietary Broadcom drivers are packaged and available in the rpmfusion repo.

Verify that your card is a Broadcom using: lspci -vnn -d 14e4:

Sample output:

02:00.0 Network controller [0280]: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)

Install

Install the rpmfusion repo, note only "nonfree" is required, as the Broadcom Driver is proprietry: http://rpmfusion.org/

@chp-io
chp-io / git-repo-rinse
Last active June 17, 2021 20:36 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
#!/bin/sh
git reset --hard
git submodule foreach --recursive 'git reset HEAD . || :'
git submodule foreach --recursive 'git checkout -- . || :'
git submodule update --init --recursive
git clean -d -f -f -x
git submodule foreach --recursive git clean -d -f -f -x
#TODO add submodule filtering argument
@chp-io
chp-io / 99-keyremap.hwdb
Last active January 24, 2021 20:52
Key remapping on Windows and Linux
# /etc/udev/hwdb.d/99-keyremap.hwdb
# Remap a key or swap keys for a keyboard using udev
# To remap a key, replace the bus, vendor, product, scancode, keycode in:
#evdev:input:b<bus>v<vendor>p<product>*
# KEYBOARD_KEY_<scancode>=<keycode>
# Apply your changes to this file with:
# #> systemd-hwdb update && udevadm trigger
@chp-io
chp-io / gsoc20_final_work_product.md
Last active January 30, 2022 04:19
GSoC20 final work product
#!/bin/bash
set -e
# Notes:
#
# Builds on Ubuntu 18.04 with gcc-7
###############################################################################
# Get deps on Ubuntu
###############################################################################