Skip to content

Instantly share code, notes, and snippets.

@saetia
saetia / gist:1623487
Last active June 4, 2025 08:26
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@sweenzor
sweenzor / logtest.py
Created February 9, 2012 19:59
Writing to syslog with Python's logging library
import logging
import logging.handlers
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
handler = logging.handlers.SysLogHandler(address = '/dev/log')
formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s')
@TonnyXu
TonnyXu / UITableView_SeparatorLine.md
Created May 10, 2012 13:21
set UITableView.separatorLine to 2px and with different colors each pixel

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@return1
return1 / trim_enabler.txt
Last active June 6, 2025 21:05
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
@jpihl
jpihl / android_boost_filesystem.patch
Created November 14, 2012 19:08
Use this to compile boost 1.52 with the android ndk
diff --git a/libs/filesystem/src/operations.cpp b/libs/filesystem/src/operations.cpp
index 16a336f..a1504b5 100644
--- a/libs/filesystem/src/operations.cpp
+++ b/libs/filesystem/src/operations.cpp
@@ -73,13 +73,15 @@ using std::wstring;
const fs::path dot_dot_path("..");
# include <sys/types.h>
# include <sys/stat.h>
-# if !defined(__APPLE__) && !defined(__OpenBSD__)
+# if !defined(__APPLE__) && !defined(__OpenBSD__) && !defined(__ANDROID__)
@geertj
geertj / winsocketpair.py
Last active October 3, 2024 16:11
Emulates the UNIX socketpair() system call on Windows. This function uses a trick with non-blocking sockets to prevent the need for a thread. A socketpair can be used as a full-duplex, select()able pipe on Windows.
def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
"""Emulate the Unix socketpair() function on Windows."""
# We create a connected TCP socket. Note the trick with setblocking(0)
# that prevents us from having to create a thread.
lsock = socket.socket(family, type, proto)
lsock.bind(('localhost', 0))
lsock.listen(1)
addr, port = lsock.getsockname()
csock = socket.socket(family, type, proto)
csock.setblocking(0)
@wm
wm / Powerline.md
Last active May 29, 2025 01:01
Installing powerline on Mac OSX. The following was done in version Version 10.8.2

Install dependencies

brew install cmake
brew install python
sudo easy_install pip

Add powerline bin to your path. In your zshrc file (or the paths files sourced in zshrc) add the following line

PATH="/usr/local/share/python/:$PATH"

Reinstall MacVim with brew

@wesleyhales
wesleyhales / skia.debugger.steps
Created February 18, 2013 20:25
Notes for building the Skia Debugger on OSX 10.7.5.
Download QT 4.8: http://qt-project.org/downloads
Follow quickstart: https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/mac
prerequisites, chekout, build, run tests
Checkout and build SKIA Debugger
https://sites.google.com/site/skiadocs/developer-documentation/skia-debugger
I had a few problems building and kept getting strange compile errors. I waited one day and updated the code with svn up and it magically started building.
GYP_DEFINES="skia_os=mac skia_arch_width=64" make debugger
Checkout and build Chromium
@charlesbedrosian
charlesbedrosian / build.sh
Created March 9, 2013 22:03
XCode post build script to setup settings with current build information, different for Debug and Release versions
#get commit stats (date and SHA)
commit_sha=`git rev-parse --short HEAD`
commit_ts=`git show -s --format="%ci" $sha`
commit_dt=${commit_ts:0:16}
commit_count=`git log --oneline | wc -l | tr -d ' '`
SETTINGSBUNDLEPATH="$CODESIGNING_FOLDER_PATH/Settings.bundle/Root.plist"
#where are we getting the original data from?