Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@Superbil
Superbil / .clang-format.yaml
Created March 6, 2014 04:16
Custom clang-format
# BasedOnStyle: WebKit
AccessModifierOffset: -4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
@Superbil
Superbil / run_in_main.m
Created March 28, 2014 04:25
let en is second chose
// ref from: http://stackoverflow.com/questions/20241256/ios-app-default-language-en-is-not-applied
// remove what was previously stored in NSUserDefaults (otherwise the previously selected language will be still the first one in the list and your app won't be localized in the language selected in settings)
[[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"AppleLanguages"];
[[NSUserDefaults standardUserDefaults] synchronize]; // make the change immediate
// reorder the languages so English is always the default fallback
NSMutableArray *mutableLanguages = [[NSLocale preferredLanguages] mutableCopy];
NSInteger enIndex = NSNotFound;
for (NSString *lang in mutableLanguages) { if ([lang isEqualToString:@"en"]) { enIndex = [mutableLanguages indexOfObject:lang]; break; } }
@try {
@Superbil
Superbil / api_addressbook.org
Last active August 29, 2015 14:00
How to boot up addressbook at local

you will need

  1. Postgresql.app http://postgresapp.com/
  2. homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
  1. node.js
brew install npm
@Superbil
Superbil / rsync_ignore
Created April 23, 2014 20:10
rsync_ignore
.wine
.pythonbrew
.rvm
.config
.cpanm
.pow
.virtualenvs.backup
@Superbil
Superbil / iTunes.pl
Created April 30, 2014 12:26 — forked from xatier/iTunes.pl
Advance search in iTunes
#!/usr/bin/env perl
use 5.014;
use WWW::Mechanize;
use List::MoreUtils qw(uniq);
my $url = "http://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=iTunesU&submit=media&term=e%20207";
@Superbil
Superbil / multi-term.el
Last active August 29, 2015 14:00
get multi-term quickly
;;; multi-term
;;; TODO: find zsh from system configure (PATH)
(require-package 'multi-term)
(setq multi-term-program "/usr/local/bin/zsh")
(defun multi-last-term-buffer (list)
"Return most recently used term buffer."
(when list
(if (eq 'term-mode (with-current-buffer (car list) major-mode))
(car list) (multi-last-term-buffer (cdr list)))))
@Superbil
Superbil / org.superbil.rsync.plist
Created May 15, 2014 10:52
org.superbil.rsync.plist sample
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Debug</key>
<true/>
<key>Label</key>
<string>org.superbil.rsync</string>
<key>ProgramArguments</key>
<array>
{-# LINE 30 "parser.ltx" #-}
{-# LANGUAGE KindSignatures, GADTs #-}
import Data.List (inits, tails)
import Data.Char (ord)
import Control.Monad (mplus)
{-# LINE 56 "parser.ltx" #-}
data Grammar :: * where
Empty :: Grammar
Unit :: Grammar
Single :: Char -> Grammar
@Superbil
Superbil / keybase.md
Created July 14, 2014 18:49
Proof for keybase

Keybase proof

I hereby claim:

  • I am superbil on github.
  • I am superbil (https://keybase.io/superbil) on keybase.
  • I have a public key whose fingerprint is 95DA 9548 B516 EDF4 A7DC BC7D 43A1 4F99 206A FB69

To claim this, I am signing this object:

@Superbil
Superbil / DropboxAltStarter
Last active August 29, 2015 14:04
Dropbox Alt Starter and Info.plist for Mac
#!/usr/bin/env zsh
ALT_FOLDER=.dropbox-alt
ALT_HOME=/Users/$USER/$ALT_FOLDER
# Use mdfind to find Dropbox.app
for p in `mdfind Dropbox.app`;
do
if [[ -d $p ]]; then
HOME=$ALT_HOME $p/Contents/MacOS/Dropbox