Skip to content

Instantly share code, notes, and snippets.

View ladrift's full-sized avatar

Ziyi Yan ladrift

View GitHub Profile
package main
type Mutex struct{}
func (m *Mutex) Lock() {}
func (m *Mutex) Unlock() {}
type PtrMutex *Mutex
@ladrift
ladrift / string_rune_literals.go
Created August 2, 2016 15:43
String literals and rune literals in Go
package main
import "fmt"
func main() {
s1 := `日`
fmt.Printf("%q\n", s1)
fmt.Printf("% x\n", s1) // Using the "space" flag for format.
// Output:
// "日"
@ladrift
ladrift / # fcitx-remote-for-osx - 2016-05-20_17-36-42.txt
Created May 20, 2016 09:43
fcitx-remote-for-osx on Mac OS X 10.11.5 - Homebrew build logs
Homebrew build logs for fcitx-remote-for-osx on Mac OS X 10.11.5
Build date: 2016-05-20 17:36:42
@ladrift
ladrift / # fcitx-remote-for-osx - 2016-05-19_08-17-12.txt
Created May 19, 2016 00:19
fcitx-remote-for-osx on Mac OS X 10.11.5 - Homebrew build logs
Homebrew build logs for fcitx-remote-for-osx on Mac OS X 10.11.5
Build date: 2016-05-19 08:17:12
@ladrift
ladrift / gist:ee8336d6b4144b3aa9d3
Created February 1, 2016 10:33 — forked from tonymtz/gist:714e73ccb79e21c4fc9c
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@ladrift
ladrift / c_works_no.md
Created October 17, 2015 11:19 — forked from chrisyip/c_works_no.md
Fix Yosemite issues

If you encounter errors like this configure: error: C compiler cannot create executables, try this command on Terminal:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain

You should change XcodeDefault.xctoolchain and OSX10.10.xctoolchain tu suit your case.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

"""
Definition of ListNode
class ListNode(object):
def __init__(self, val, next=None):
self.val = val
self.next = next
"""
class Solution:
"""