This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Basic setup | |
let mapleader="," | |
set clipboard=unnamed | |
execute pathogen#infect() | |
syntax on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Basic example of using Python with vim | |
" This is basic vim plugin boilerplate | |
let s:save_cpo = &cpo | |
set cpo&vim | |
function! s:UsingPython3() | |
if has('python3') | |
return 1 | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Insert content into vim buffer programmatically | |
" Exe: | |
:exe ":normal i" . "some" | |
" FeedKeys: | |
:call feedkeys("i". "some") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func helloWorld(a: Int) { | |
print("Hello world!", 1) | |
} | |
// Converting to an address: | |
// - Erase the type to an Object so swift doesn't complain | |
// - Bitcast | |
var erasedFunc = helloWorld as AnyObject | |
let address = unsafeBitCast(erasedFunc, to: Int.self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path to the swift compiler | |
SWIFT=(~/myswift/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift) | |
SWIFTC=(~/myswift/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swiftc) | |
IFS='' read -d '' -r SOURCE <<"EOF" | |
struct Some { | |
let attr = 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all of the current branches - invert * as it represents the current one | |
# and will cause many issues | |
for B in $(git branch --list | grep --invert '*'); do git branch -D $B; done | |
# Additional ideas are cleaning up the remote ( i.e. ): | |
for B in $(git branch -a --list | grep --invert '*'); do git push origin : $B; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This program cleans out the implcit module cache and modulemaps. | |
# Remove modulemaps to prevent loading lingering invalid modulemaps | |
# ( Genfiles is not cleared for each incremental build ) | |
set -e | |
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
WORKSPACE_DIR="$SCRIPTPATH/../" | |
EXEC_ROOT=$($WORKSPACE_DIR/tools/bazelwrapper info execution_root) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nm __BINARY__ | awk '{ print $3 }' | xargs xcrun swift-demangle {} \; | less |