Skip to content

Instantly share code, notes, and snippets.

View nickdesaulniers's full-sized avatar

Nick Desaulniers (paternity leave) nickdesaulniers

View GitHub Profile
@TooTallNate
TooTallNate / node_pointer.h
Last active April 7, 2016 02:03
C helper functions for wrapping and unwrapping Node Buffer instances as "pointers"
/*
* Helper functions for treating node Buffer instances as C "pointers".
*/
#include "v8.h"
#include "node_buffer.h"
/*
* Called when the "pointer" is garbage collected.
@hgomez
hgomez / mint141516.md
Last active October 23, 2018 14:08
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15

BR2_aarch64=y
BR2_cortex_a57=y
BR2_OPTIMIZE_3=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_HTOP=y
BR2_PACKAGE_VIM=y
@nathanhammond
nathanhammond / Emscripten OS X.md
Created March 4, 2012 21:48
How to get Emscripten running on OS X.

Running emscripten on OS X

There are a number of additional dependencies required for getting things installed on OS X. Starting with a blank slate OS X machine, this is the process it takes:

# Install Xcode Command Line Tools

# Install Homebrew
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
@rcmachado
rcmachado / html5.vim
Created December 15, 2009 10:35
Vim syntax file for HTML 5
" Vim syntax file
" Language: HTML (version 5)
" Maintainer: Rodrigo Machado <rcmachado@gmail.com>
" URL: http://gist.github.com/256840
" Last Change: 2010 Aug 26
" License: Public domain
" (but let me know if you liked it :) )
"
" Note: This file just adds the new tags from HTML 5
" and don't replace default html.vim syntax file
@gre
gre / README.md
Last active November 12, 2021 15:20
Boilerplate of a JS1K submission + JSCrush & uglify tools

JS1K Boilerplate

Build tools

Install tools

npm install
anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected
@sergnechaev
sergnechaev / sdl2_opengl.cpp
Last active September 26, 2022 02:34 — forked from exavolt/sdl2_opengl.c
Very basic SDL2 OpenGL application (C++1y)
#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
constexpr int SCREEN_WIDTH = 800;
constexpr int SCREEN_HEIGHT = 600;
@nico
nico / c_inline.md
Last active July 25, 2023 18:43
C vs C++ inline function semantics, and ODR vs /arch:

The semantics of inline are one of the areas where C and C++ are pretty different. This post is about the C++ semantics, but the history is interesting, so here's a short summary of it.

The meaning of "inline" is intuitively easy to understand: It gives the compiler a hint that it'd be nice if a function could be inlined. It gets a bit complicated because of two issues:

  1. If the function ends up not being inlined, where should the definition of the function be emitted?
  2. If the inline function contains a static local variable, should that be inlined? Should there be several copies of the static local, or just one?
@paulirish
paulirish / performance.now()-polyfill.js
Last active August 1, 2023 15:42
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed