Firstly, install macvim and get the keyboard working
Note: easiest way here is to use macvim from brew
brew install macvim --with-override-system-vim
In .vimrc
| /** | |
| * Beast HTTP server example with long running operations and lib dispatch. | |
| * | |
| * Note: Assume that we are calling dispatch_main() after running the server | |
| */ | |
| #include "file_body.hpp" | |
| #include "mime_type.hpp" | |
| #include <beast/http.hpp> |
| # Use ctrl-a for prefix | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind C-a send-prefix | |
| # OSX Fix copy and paste. If on ZSH replace bash with ZSH | |
| set-option -g default-command "reattach-to-user-namespace -l bash" | |
| # improve colors | |
| set -g default-terminal "screen-256color" |
| " Basic setup | |
| let mapleader="," | |
| set clipboard=unnamed | |
| execute pathogen#infect() | |
| syntax on |
| #!/bin/bash | |
| # run_ios_sim builds and runs an iOS app on the simulator | |
| # | |
| # It is designed to replicate the behavior of "Run" in Xcode and assumes basic | |
| # xcodebuild usage. | |
| # | |
| # USAGE: | |
| # export IOS_SIM_UDID=342F9A20-DF48-41A9-BE60-C6B35F47E97F; \ | |
| # export BUNDLE_IDENTIFIER=a.Some; \ | |
| # export APP_PATH=$PWD/Build/Debug-iphonesimulator/$APP_NAME.app \ |
| function! Generate_placeholder_pattern() | |
| return '<#\%(T##\)\?\%([^#]\+##\)\?\([^#]\+\)#>' | |
| endfunction | |
| function! Jump_to_placeholder() | |
| if &filetype !=# 'swift' | |
| return '' | |
| end | |
| if !Check_placeholder_existence() |
| # YouCompleteMe configuration for OSX development | |
| import os | |
| import ycm_core | |
| flags = [ | |
| '-resource-dir', | |
| '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0', | |
| '-isysroot', | |
| '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk', | |
| '-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include', |
| #!/bin/sh | |
| # Create a RAM disk with same perms as mountpoint | |
| # Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
| # Usage: sudo ./xcode_ramdisk.sh start | |
| USERNAME=$(logname) | |
| TMP_DIR="/private/tmp" | |
| RUN_DIR="/var/run" | |
| SYS_CACHES_DIR="/Library/Caches" |
| %%% @author Sergey Prokhorov <[email protected]> | |
| %%% @copyright (C) 2013, Sergey Prokhorov | |
| %%% @doc | |
| %%% Walker alias method - efficient random selection with defined probabilities. | |
| %%% <http://en.wikipedia.org/wiki/Alias_method> | |
| %%% | |
| %%% > ProbabilityValueList = [{10, a}, {20, b}, {30, c}, {40, d}], | |
| %%% > WalkerVectors = walker_alias:build(ProbabilityValueList), | |
| %%% > RandomValue = walker_alias:choice(WalkerVectors). | |
| %%% |
| function roughSizeOfObject( object ) { | |
| var objectList = []; | |
| var stack = [ object ]; | |
| var bytes = 0; | |
| while ( stack.length ) { | |
| var value = stack.pop(); | |
| if ( typeof value === 'boolean' ) { |