Skip to content

Instantly share code, notes, and snippets.

View monkeyxite's full-sized avatar
💭
I may be slow to respond.

Jonny Hou monkeyxite

💭
I may be slow to respond.
  • Stockholm
  • 12:51 (UTC +02:00)
View GitHub Profile
@monkeyxite
monkeyxite / vimdiff.md
Created October 13, 2018 17:10 — forked from mattratleph/vimdiff.md
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)

@monkeyxite
monkeyxite / hterm_solarized.js
Last active November 29, 2016 13:58 — forked from organisciak/hterm_solarized.js
Solarized for Mosh Chrome
// Solarized for Mosh Chrome
// Mosh does not seem to save profiles, so this sets the default 'mosh' profile.
// To reset, evaluate term_.prefs_.resetAll()
// Run in the JavaScript console of mosh_browser.html, which can be opened
// as explained here:
// https://github.com/rpwoodbu/mosh-chrome/wiki/FAQ#how-can-i-change-the-way-the-terminal-looks-font-color-etc
var htermProfiles = {
// Solarized Dark
@monkeyxite
monkeyxite / find_system_python_dylibs.sh
Created January 24, 2016 09:15 — forked from gyaresu/find_system_python_dylibs.sh
This script prints the filenames of any libs in your /usr/local/lib that depend on the System Python. It is especially useful if you use a non-system Python, but have previously compiled extensions against the System Python - it will tell you which need to be recompiled.
#!/bin/bash
echo "This script prints the filenames of any dylibs in your /usr/local/ that depend on the System Python"
for f in `find /usr/local/lib`; do
otool -L "$f" 2> /dev/null| grep Python | grep System &> /dev/null
status=$?
if [ $status -eq 0 ]; then
echo "$status: $f"
fi
done
@monkeyxite
monkeyxite / cmake4grxxx
Created January 24, 2016 08:49
cmake for brew installed gr-xxx components which rely on brewed python not system python
cmake -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib ../
import os
def list_files(startpath):
for root, dirs, files in os.walk(startpath):
level = root.replace(startpath, '').count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
for f in files:
print('{}{}'.format(subindent, f))
@monkeyxite
monkeyxite / plot by matplotlib widget from Qt Designer
Created January 3, 2014 07:35
matplotlib Qt widget plotting
from sys import argv
from PyQt4 import QtGui, QtCore
# Import the interface class
import main_window
#matplotlibwidget is inherit from matplotlibwidget in site-packages, which pointed by matplotlibplugin.py of Qt Desiner python plugin -- matplotplugin
#several options of this matplotlibwidget implementation as matplotlibwidget_withbar.py or mplwidget.py could apply as your demands
from matplotlibwidget import *