Skip to content

Instantly share code, notes, and snippets.

@sv99
sv99 / macvim-pyenv.md
Last active August 18, 2020 10:11
build macvim with python from env
println("Hello")
var conn = Socket().connect(8000, address: "127.0.0.1").listen(limit:128).accept() { connection, address in
println("Accepted a connection from port \(address.addressString)")
return connection
}.read() { connection, inStr in
let arr = inStr.componentsSeparatedByString("\n")
let response = (arr[0].uppercaseString + "\n")
return connection.write(response)
}.close()
@danro
danro / Custom.css
Created September 16, 2012 17:32
Improved webkit inspector toolbar
#-webkit-web-inspector #toolbar {
background: #cdcdcd !important;
height: 36px !important;
}
#-webkit-web-inspector #main {
top: 36px !important;
}
#-webkit-web-inspector .toolbar-item.elements:hover:after {
content: "elements";
z-index: 9999;
@badsyntax
badsyntax / timeago.js
Created March 26, 2012 13:06
Javascript date time ago
Ext.Date.fuzzy = function(time, local){
(!local) && (local = Date.now());
if (typeof time !== 'number' || typeof local !== 'number') {
return;
}
var
offset = Math.abs((local - time)/1000),
@andormade
andormade / main.c
Created November 12, 2011 18:00
Audio Queue example
#include <stdlib.h>
#include <math.h>
#include <AudioToolbox/AudioQueue.h>
#include <CoreAudio/CoreAudioTypes.h>
#include <CoreFoundation/CFRunLoop.h>
#define NUM_CHANNELS 2
#define NUM_BUFFERS 3
@wadey
wadey / iterm2.zsh
Last active March 10, 2024 00:32
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"

Objective-C Coding Convention and Best Practices

Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.

This document is mainly targeted toward iOS development, but definitely applies to Mac as well.

Operators

NSString *foo = @"bar";