Skip to content

Instantly share code, notes, and snippets.

View asselin's full-sized avatar

Andre Asselin asselin

View GitHub Profile
@LeZuse
LeZuse / 00_README.md
Last active October 29, 2025 12:26
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@dubzzz
dubzzz / jest-typings-for-tobeinstanceof.ts
Last active August 2, 2025 20:25
jest-typings-for-tobeinstanceof
class A {
a() { }
}
class B {
b() { }
}
class C extends B {
c() { }
}
class HasStaticNameMethod {
@k3174r0-75uch1y4
k3174r0-75uch1y4 / trackpointkeyboard.json
Created December 5, 2017 11:09
setting for karabiner-elements to use trackpoint keyboard on mac OS sierra.
{
"title": " Thinkpad keyboard",
"rules": [
{
"description": "中クリック問題",
"manipulators": [
{ "type": "basic",
"from": {
"pointing_button": "button3"
}
@kerryboyko
kerryboyko / README.md
Last active April 26, 2023 16:08
VueJS Best Practices Guide

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@paulirish
paulirish / what-forces-layout.md
Last active May 4, 2026 19:42
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@StevenLangbroek
StevenLangbroek / 00_decorators.js
Last active September 20, 2016 08:22
Backbone with decorators (warning: untested) *update*: corrections from Ben applied.
import _ from 'underscore';
export function on(eventName){
return function(target, name, descriptor){
if(!target.events) {
target.events = {};
}
if(_.isFunction(target.events)) {
throw new Error('The on decorator is not compatible with an events method');
return;
@asselin
asselin / doc.html
Created May 21, 2012 15:32
Handlebars helper for generic Javascript expressions
This helper allows you to use generic javascript expressions in a handlebars template. It can be used to call Javascript functions on a value or do data structure access that Handlebars doesn't support (e.g. accessing an element of an array).
@asselin
asselin / example.html
Created May 21, 2012 15:25
Handlebars block helper to extend if to support generic Javascript logical expressions
{{#jsif "astring=='abc'"}}
Is true
{{else}}
Is false
{{/jsif}}
@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");