Skip to content

Instantly share code, notes, and snippets.

View asselin's full-sized avatar

Andre Asselin asselin

View GitHub Profile
@asselin
asselin / rollup-typescript.md
Last active September 29, 2022 18:18 — forked from aleclarson/rollup-typescript.md
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@asselin
asselin / trackpointkeyboard.json
Last active November 4, 2021 01:07 — forked from k3174r0/trackpointkeyboard.json
setting for karabiner-elements to use trackpoint keyboard on mac OS sierra.
{
"title": " Thinkpad keyboard",
"rules": [
{
"description": "Fix Thinkpad keyboard scroll",
"manipulators": [
{ "type": "basic",
"from": {
"pointing_button": "button3"
}
@asselin
asselin / back.js
Created October 5, 2018 16:46
How to detect browser back button
window.addEventListener("popstate", function(args) {console.log("pop ", args);}, false);
@asselin
asselin / solution.html
Last active March 24, 2017 20:26
Code snippets for "Tech note: Using VueJS events together with v-model"
<template>
<label role="radio" tabindex="0">
<input type="radio" v-on:change="clicked" name="r1" value="One" v-model="picked">
<span>One</span>
</label>
<label role="radio" tabindex="0">
<input type="radio" v-on:change="clicked" name="r1" value="Two" v-model="picked">
<span>Two</span>
</label>
@asselin
asselin / example1.html
Last active March 24, 2017 20:26
Code snippets for "Tech note: Using VueJS events together with v-model"
<template>
<label role="radio" tabindex="0">
<input type="radio" v-on:something="clicked" name="r1" value="One" v-model="picked">
<span>One</span>
</label>
<label role="radio" tabindex="0">
<input type="radio" v-on:something="clicked" name="r1" value="Two" v-model="picked">
<span>Two</span>
</label>
@asselin
asselin / component.js
Last active February 9, 2017 20:58
Dynamically extending a Vue Object
import Vue from 'Vue';
beforeCreate () {
this.$options = Vue.util.mergeOptions({
data: function() {
return {
selectedItem: 8
}
},
computed: {
@asselin
asselin / OpenWithSublimeText3.bat
Last active November 30, 2016 21:24 — forked from roundand/OpenWithSublimeText3.bat
Open folders with Sublime Text 3 from windows explorer context menu (tested in Windows 10)
@echo off
FOR /F "tokens=* USEBACKQ" %%F IN (`where sublime_text`) DO (
SET st3Path=%%F
)
ECHO %st3Path%
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@asselin
asselin / compile.js
Last active March 3, 2016 15:16
Code for 'Client Side Swagger Support for AngularJS' http://www.pointsource.com/blog/client-side-swagger-support-for-angularjs
var SwaggerParser = require('swagger-parser');
var fs = require('fs');
var CodeGen = require('swagger-js-codegen').CodeGen;
SwaggerParser.validate('uber-v1.yaml').then(
function(api) {
var angularjsSourceCode = CodeGen.getAngularCode({
className: 'UberV1',
swagger: api
});
@asselin
asselin / callback.js
Created April 23, 2014 02:01
promises
function getData(callback) {
var result = {};
getJSONAsync('/users',
function(data) {
result.users = data;
getJSONAsync('/companies',
function(data) {
result.companies = data;
getJSONAsync('/contacts',
@asselin
asselin / dialog.html
Created August 1, 2012 02:01
"Popup Dialog" styling of a div
<div style="position: fixed; background-color: green; top: 5%; bottom: 5%; left: 5%; right: 5%;">
<div style="position: absolute; bottom: 0px; color: white;">
Hi
</div>
</div>