Skip to content

Instantly share code, notes, and snippets.

@joeynguyen
joeynguyen / 01.make
Created December 3, 2014 05:17
Neovim OSX build 01.make
2014-11-30 00:30:58 -0600
make
CMAKE_BUILD_TYPE=RelWithDebInfo
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/Cellar/neovim/HEAD"
install
mkdir -p .deps/build/third-party
cd .deps/build/third-party && \
cmake -G 'Unix Makefiles' \
@joeynguyen
joeynguyen / 01.make.cc
Created December 3, 2014 05:19
Neovim OSX build - 01.make.cc
clang called with: CMakeCCompilerId.c
superenv added: -pipe -w -Os -march=native -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names
superenv executed: clang -pipe -w -Os -march=native CMakeCCompilerId.c -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names
clang++ called with: CMakeCXXCompilerId.cpp
superenv added: -pipe -w -Os -march=native -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers -L/usr/local/lib -L/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries -Wl,-headerpad_max_install_names
superenv e
@joeynguyen
joeynguyen / launch.json
Created July 17, 2017 17:41
WebDriverIO/Cucumber.js Visual Studio Code "Debugging" launch config
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"protocol": "legacy",
"port": 5859,
@joeynguyen
joeynguyen / launch.json
Created July 17, 2017 17:42
WebDriverIO/Cucumber.js - Example Visual Studio Code "Debugging" launch config
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [{
"type": "node",
"request": "launch",
"protocol": "legacy",
"port": 5859,
@joeynguyen
joeynguyen / jsconfig.json
Last active January 29, 2019 21:28
Use Typescript to check JavaScript
// add this file to the root of your repo without these comment lines
// inside `compilerOptions`, include "moduleResolution": "node" if it's a Node project
// remove `jsx` lines if not using JSX
{
"compilerOptions": {
"target": "es2017",
"checkJs": true,
"jsx": "react"
},
"include": [
@joeynguyen
joeynguyen / isMomentPropType.js
Last active August 22, 2019 16:46
custom PropTypes validator for Moment object
import moment from 'moment'; // tested using v2.24.0
// custom PropType validator per example at
// https://github.com/facebook/prop-types/blob/v15.7.2/README.md#usage
export function isMomentPropType(props, propName, componentName) {
if (!moment.isMoment(props[propName])) {
return new Error(
`Invalid prop ${propName} supplied to ` +
`${componentName} is not a Moment object. Validation failed.`
);
@joeynguyen
joeynguyen / .Xmodmap
Created March 30, 2020 19:23
.Xmodmap for HHKB (Happy Hacking Keyboard)
! .Xmodmap
! HHKB emulator
! Fn
remove mod1 = Alt_R
keysym Alt_R = Mode_switch
add mod5 = Mode_switch
! arrows
keycode 34 = bracketleft braceleft Up NoSymbol
@joeynguyen
joeynguyen / generators.md
Created March 30, 2020 19:24 — forked from learncodeacademy/generators.md
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@joeynguyen
joeynguyen / Atreus2-Firmware.ino
Last active January 8, 2021 00:08
Joey's Keyboardio Atreus2 Firmware with modifiers on home row
/* -*- mode: c++ -*-
* Atreus -- Chrysalis-enabled Sketch for the Keyboardio Atreus
* Copyright (C) 2018, 2019 Keyboard.io, Inc
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
// -*- mode: c++ -*-
// Copyright 2016 Keyboardio, inc. <jesse@keyboard.io>
// See "LICENSE" for license details
#ifndef BUILD_INFORMATION
#define BUILD_INFORMATION "locally built"
#endif
/**