Skip to content

Instantly share code, notes, and snippets.

yetone / karabiner.json
Last active Apr 9, 2020
Karabiner 通过 left shift 来切换中英文
View karabiner.json
"description": "Switch between zh-Hans <-> en (left_shift)",
"manipulators": [
"conditions": [
"input_sources": [
"language": "en"
quagliero /
Last active Aug 27, 2020
Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

Installing cpuminer-multi on macOS 10.13.2 (High Sierra)

This assumes you have brew installed and are comfortable using a terminal.

Following the guide on will likely lead to errors about invalid paths to OpenSSL, and neoscrypt errors to the tune of Undefined symbols for architecture x86_64 during the build. I managed to piece together different fixes into an installation that has worked for me. So I hope it works for you.


Ensure a c compiler is installed. Type g++ in the terminal and continue with the xcode installation if necessary. If it prints clang: error: no input files, then you can proceed.

teamon / box.ex
Created Aug 25, 2017
Define elixir structs with typespec with single line of code
View box.ex
defmodule Box do
defmacro __using__(_env) do
quote do
import Box
@doc """
Define module with struct and typespec, in single line
dvnguyen /
Created Jan 15, 2017
Brew Installs for macOs
#!/usr/bin/env zsh
brew update
brew upgrade
# Install GNU core utilities (those that come with macOS are outdated).
# Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH`.
brew install coreutils
# Install some other useful utilities like `sponge`.
jdiaz5513 /
Last active Jul 7, 2020
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
butihuzi / CommUtil.cpp
Created Sep 23, 2013
cocos2d-x render to texture with OpenGL CCGLProgram. cocos2d-x 中给 ccSprite 添加灰白滤镜(类似黑白照片效果)。
View CommUtil.cpp
void CommUtil::disableSprite(CCSprite* sp)
const GLchar* pszFragSource =
"#ifdef GL_ES \n \
precision mediump float; \n \
#endif \n \
uniform sampler2D u_texture; \n \
varying vec2 v_texCoord; \n \
varying vec4 v_fragmentColor; \n \
void main(void) \n \
View ST2 - Default shortcuts.txt
Sublime Text 2 - Default shortcuts cheatsheet (PC keyboard)
* Go to file (CTRL + P)
* Go to project (CTRL + ALT + P)
* Go to methods (CTRL + R)
* Go to line (CTRL + G)
* Toggle side bar (CTRL + KB)
mattratleph /
Last active Oct 21, 2020 — forked from roothybrid7/
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)
kconragan /
Last active Sep 22, 2020
Enable key repeat in Apple Lion for Sublime Text in Vim mode
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
You can’t perform that action at this time.