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
if echo $PWD | grep -e "./projects"; then | |
allArgs="$*" | |
basedir=$PWD | |
for curdir in */; do | |
cd $curdir | |
if test -d ./.git | |
then | |
echo "\n\n${curdir}\n\n" | |
git ${allArgs} | |
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
#!/bin/sh | |
set -e | |
set -x | |
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f2) | |
do | |
npm -g install "$package" | |
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
// Example data from a JSON API that returns an array where each object | |
// has a unique ID. However the API returns the data in a random order. | |
var myObjects = [ | |
{ | |
data: 'APPL', | |
id: 33 | |
}, | |
{ | |
data: 'MSFT', | |
id: 241 |
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
# better prefix key | |
set -g prefix C-a | |
bind C-a send-prefix | |
# better splitting | |
bind | split-window -h -c "#{pane_current_path}" | |
bind - split-window -v -c "#{pane_current_path}" | |
# less colourful status | |
set -g status-bg colour240 | |
set -g status-fg white | |
# 256 colors support |
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
if echo $PWD | grep -e ".vim/bundle"; then | |
bdir=$PWD | |
for curdir in */; do | |
cd $curdir | |
echo "\n\n${curdir}\n\n" | |
git pull | |
cd $bdir | |
done | |
else | |
echo 'This script must be ran from within your .vim/bundle directory' |
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
import Foundation | |
extension String { | |
public var JSONminify: String { | |
// http://stackoverflow.com/questions/8913138/ | |
// https://developer.apple.com/reference/foundation/nsregularexpression#//apple_ref/doc/uid/TP40009708-CH1-SW46 | |
let minifyRegex = "(\"(?:[^\"\\\\]|\\\\.)*\")|\\s+" | |
if let regexMinify = try? NSRegularExpression(pattern: minifyRegex, options: .caseInsensitive) { |
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<list> | |
#include<map> | |
#include<queue> | |
#include<cstdlib> | |
#include<boost/asio.hpp> | |
#include<boost/thread.hpp> | |
#include<boost/asio/ip/tcp.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
#include<iostream> | |
#include<queue> | |
#include<string> | |
#include<cstdlib> | |
#include<boost/thread.hpp> | |
#include<boost/bind.hpp> | |
#include<boost/asio.hpp> | |
#include<boost/asio/ip/tcp.hpp> | |
#include<boost/algorithm/string.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
#define PLATFORM_WINDOWS 1 | |
#define PLATFORM_MAC 2 | |
#define PLATFORM_LINUX 3 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#if defined(_WIN32) |
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
#define PLATFORM_WINDOWS 1 | |
#define PLATFORM_MAC 2 | |
#define PLATFORM_LINUX 3 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#if defined(_WIN32) |
NewerOlder