Skip to content

Instantly share code, notes, and snippets.

View manuhabitela's full-sized avatar
🦆

Emmanuel Pelletier manuhabitela

🦆
View GitHub Profile
@manuhabitela
manuhabitela / keymap_leimi.c
Last active September 16, 2020 23:44
Layout GH60 RevCHN - spaceFN, ctrl on capslock, ISO missing key on fn layer
#include "keymap_common.h"
/* following https://gist.github.com/Leimi/bca49d02e48c018ce4c8 to flash firmware on GH60 RevCHN */
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* layer0: 60% qwerty with custom modifiers
* ESC instead of GRV, FN1 instead of LGUI, LGUI instead of LCTL, LCTL instead of CAPS, SPACEFN instead of SPACE */
KEYMAP_ANSI(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \

This is a quick guide to changing the keymap on the GH60 "Satan" or RevCHN. Note that the Satan is NOT a true GH60, and using the GH60 with the normal TMK would not work.

Note that installing dependencies or compiling TMK is not a part of the scope of this document. If you have problems with this part, seek help elsewhere. Not also that these instructions are written for Linux and Mac. If you're using windows, just use the Command Prompt for the git commands, and Windows Explorer to move and delete files.

  1. Dependencies.
  2. Download and install GIT: https://git-scm.com/downloads
  3. Download and install the dependencies for compiling TMK: https://github.com/tmk/tmk_keyboard/blob/master/doc/build.md (Point 1 only)
  4. Using git, download the TKG toolkit. https://github.com/kairyu/tkg-toolkit git clone git@github.com:kairyu/tkg-toolkit.git tkg
  5. Still using git, download Kairyu's fork of TMK. https://github.com/kairyu/tmk_keyboard_custom git@github.com:kairyu/tmk_keyboard_custom.git tmk
@manuhabitela
manuhabitela / ubuntu-eol.md
Created October 15, 2015 09:56 — forked from dergachev/ubuntu-eol.md
What to do when your ubuntu distro is End-of-Life

Let's say you're using Ubuntu 13.04 (Raring Ringtail, released in April 2013) and it just went End-of-Life on you, because it's supported for only 6 months, and the deprecated packages are taken down after 12 months.

You'll probably figure this out the hard way. When you run sudo apt-get update, it will eventually report these errors:

Ign http://archive.ubuntu.com raring-updates/universe Sources/DiffIndex
Err http://security.ubuntu.com raring-security/main Sources
  404  Not Found [IP: 91.189.91.15 80]
Err http://security.ubuntu.com raring-security/universe Sources
  404  Not Found [IP: 91.189.91.15 80]

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

@manuhabitela
manuhabitela / _grid.scss
Last active January 11, 2021 14:15
Making the Bootstrap grid with Susy and sass-mq
// this is (a start of) an example of a Susy+mq() setup that mimics bootstrap grid.
// I work on multiple bootstrap-based projects.
// I want to stop using grid classes in the markup, and start using mixins with susy and sass-mq.
// Since the project is heavily tied to the bootstrap grid, I want to have the exact same behavior
// between bootstrap classes (old code) and susy mixins (new code).
// all the grid classes generated below are here to ease up testing.
// required: susy + sass-mq
@manuhabitela
manuhabitela / compile.js
Last active September 4, 2019 08:51
Checking environment in (node) Sass
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var sass = require('node-sass');
var ENV = process.env.SASS_ENV || 'development';
var file = 'variables.scss';
//if in dev, directly pass file to sass
if (ENV === "development") {
#!/usr/bin/env python
#-------------------------------------------------
# file: twitcher.py
# author: Florian Ehmke
# description: dmenu for twitch streams
#-------------------------------------------------
import argparse
import requests
from subprocess import Popen, PIPE, STDOUT
@manuhabitela
manuhabitela / bootstrap-breakpoint-indicator-bookmarklet.js
Last active December 2, 2015 07:52
Bookmarklet showing current bootstrap breakpoint at the top left of the page
(function(){
var script = document.createElement("script");
script.src = "https://rawgit.com/Leimi/122905f66682fb3c4927/raw/source.js";
document.getElementsByTagName("head")[0].appendChild(script);
})();
@manuhabitela
manuhabitela / _tabs.scss
Last active August 29, 2015 14:00
Simple JS tabs with Backbone
.Tabs-tabs {
@extend .u-inlineList;
}
.Tabs-tab {
}
.Tabs-link {
&:hover,
@manuhabitela
manuhabitela / create-drawing.php
Last active November 26, 2020 11:08
DrawingBoard: let people draw and save their images server-side https://github.com/Leimi/drawingboard.js
<?php
//server-side code where we save the given drawing in a PNG file
$img = filter_input(INPUT_POST, 'image', FILTER_SANITIZE_URL);
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
//see http://j-query.blogspot.fr/2011/02/save-base64-encoded-canvas-image-to-png.html
$img = str_replace(' ', '+', str_replace('data:image/png;base64,', '', $img));
$data = base64_decode($img);