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
:: batch file that copies the necessary files for Vim | |
:: You need to have cygwin installed to use this | |
:: | |
:: What it does | |
:: * Copies .vim, .vimrc, .gvimrc, and some of my separate .vimrc files to | |
:: home directory | |
:: * clones neobundle.vim from github | |
:: * clones vimproc.vim from github and builds the dll for cygwin | |
:: | |
:: This script must be executed by doubly clicking the .bat file from Windows |
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/sh | |
if [ `which brew | grep 'brew$'` = "" ]; then | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
fi | |
if [ ! -e ~/.zshrc_local -o `grep '\$(brew --prefix coreutils)/libexec/gnubin' ~/.zshrc_local` = "" ]; then | |
echo 'export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"' >> ~/.zshrc_local | |
fi |
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
#include <ncurses.h> | |
#include <unistd.h> | |
#include <string> | |
// Compile program with -lncursesw option | |
int main(int argc, char const* argv[]) { | |
WINDOW* win; | |
std::string mes = "♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟"; |
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
#include <iostream> | |
int* bar() { | |
int* ret = new int; | |
return ret; | |
} | |
int main() { | |
for (int i = 0; i < 10; i++) { | |
int ptr = *bar(); |
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/sh | |
CMD='git config --global alias' | |
add_alias() { | |
ALIAS=`eval $CMD.$1` | |
if [[ -z "$ALIAS" ]]; then | |
eval "$CMD.$1 $2" | |
elif [[ $ALIAS != $2 ]]; then | |
printf "%-4s already defined as %s\n" $1 $ALIAS |
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
#include <iostream> | |
#include <vector> | |
#include <numeric> | |
#include <cstdio> | |
int main() { | |
int set = 1; | |
int num; | |
while (true) { |
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
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <iterator> | |
#include <boost/foreach.hpp> | |
#include <utility> | |
typedef Pair std::pair<std::string, int> | |
int main() { |
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
#!/usr/bin/env ruby | |
class Class | |
def foo | |
puts "FOO!!" | |
return false | |
end | |
end | |
str = "foa" |
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
#!/usr/bin/env ruby | |
require 'benchmark' | |
# Access HDD (on /dev/sdb?) | |
# If it takes too long to respond, it has spun down | |
CMD = 'ls /data/Videos >/dev/null' | |
# Range of minutes to wait. Spin-down should be within this range | |
WAIT_MINS = [44, 45] | |
# If it takes longer than this (secnods), disk has spun down |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
int main(const int argc, char* const argv[]) { | |
std::streambuf* buf; | |
if (argc >= 2) { | |
std::cout << "Got two or more args" << std::endl; | |
// OK |
OlderNewer