Skip to content

Instantly share code, notes, and snippets.

View ipetepete's full-sized avatar

Peter Peterson ipetepete

  • NOIRLab
  • Tucson, AZ
View GitHub Profile
#define Pr .299
#define Pg .587
#define Pb .114
// public domain function by Darel Rex Finley, 2006
//
// This function expects the passed-in values to be on a scale
// of 0 to 1, and uses that same scale for the return values.
#define Pr .299
#define Pg .587
#define Pb .114
// public-domain function by Darel Rex Finley
//
// The passed-in RGB values can be on any desired scale, such as 0 to

KC60 Keyboard end-user tips, tricks, programming notes, etc.

Leimi's note: removed lots of stuff from the original gist of scottjl, (thanks to him by the way!), as in the end some wasn't useful for me. If you are intestered, go check the gist revisions.

The KC60 is kinda like a premade GH60 that was first sold on Massdrop during summer 2015.
It runs on TMK firmware, or something based on it at least (not sure this is the real source for the keyboard but it seems it is), which means it's heavily programmable.
There is a GUI tool (the source of this tool seems to be here) and a command-line tool to ease up the process of programming the board.
**Go check this great article on Key

@ipetepete
ipetepete / private.xml
Created July 22, 2016 19:43
Karabiner Consumer Key Remapping
<?xml version="1.0"?>
<root>
<item>
<name>Plus Volume Up</name>
<identifier>private.plus_and_fn_volume_up</identifier>
<autogen>
--KeyToConsumer--
KeyCode::EQUAL, ModifierFlag::CONTROL_L,
ConsumerKeyCode::VOLUME_UP
</autogen>

Keybase proof

I hereby claim:

  • I am ipetepete on github.
  • I am ipetepete (https://keybase.io/ipetepete) on keybase.
  • I have a public key ASDtZP4pzKmKABdPUxvc3K6f4PLc_0g-CHZmH0qXeVv4dAo

To claim this, I am signing this object:

@ipetepete
ipetepete / English.js
Created January 20, 2016 13:29 — forked from naxmefy/English.js
Unity3D Internationalization (I18N)
#pragma strict
public class English {
public static var lang : Hashtable = {
// General
"game_name": "My Awesome Game"
// Menus
, "new_game" : "New Game"
, "save_game" : "Save Game"
@ipetepete
ipetepete / mersenne-twister.js
Created November 10, 2015 22:41 — forked from banksean/mersenne-twister.js
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
# Install reattach-to-user-namespace from
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set -g default-terminal "screen-256color"
set-window-option -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
@ipetepete
ipetepete / hn_seach.js
Created October 1, 2015 21:01 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments);
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
# let emmet expand in mustache files (templates)
'atom-text-editor[data-grammar="text html mustache"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
# let emmet expand in javascript files ( good for templates )
'atom-text-editor[data-grammar="text html javascript"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
# Bind 'j k' to switch to normal mode (vim-mode)
'atom-text-editor.vim-mode.insert-mode':