This file contains hidden or 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
git symbolic-ref HEAD 2>/dev/null | sed -e 's|^refs/heads/||' |
This file contains hidden or 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
function change-prompt -d "Change your fish prompt." | |
set fish_main_config_dir $HOME/.config/fish | |
set fish_current_prompt_location $fish_main_config_dir/functions/fish_prompt.fish | |
set fish_new_prompt_location $fish_main_config_dir/prompts/$argv[1].fish | |
if test -f $fish_new_prompt_location | |
if test -f $fish_current_prompt_location | |
mv -f $fish_current_prompt_location $fish_current_prompt_location.bak | |
end |
This file contains hidden or 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 <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void * print_message(void *); | |
int main(void) { | |
pthread_t thread_1; | |
pthread_t thread_2; |
This file contains hidden or 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
# grunt ---stack | |
# Running "clean:build" (clean) task | |
# Running "emberTemplates:app" (emberTemplates) task | |
# File "./app/.templates.js" created. | |
# Running "build-index" task | |
# generating from: | |
# - node_modules/loom-generators-ember/loom | |
# created: app/.index.js |
This file contains hidden or 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
set FISH_CONFIG_FILE $HOME/.config/fish/config.fish | |
set INITIAL_GEMS bundler foreman pry | |
set RBENV_HOME_DIRECTORY $HOME/.rbenv | |
set RBENV_RUBIES 2.1.0 jruby-1.7.10 # example: set RBENV_RUBIES 1.9.3 2.1.0 jruby-1.7.10 | |
set RBENV_GLOBAL_RUBY $RBENV_RUBIES[1] | |
git clone 'https://github.com/sstephenson/rbenv.git' $RBENV_HOME_DIRECTORY | |
and mkdir -p $RBENV_HOME_DIRECTORY/{cache,plugins} | |
# . $FISH_CONFIG_FILE | |
cd $HOME/.rbenv/plugins |
This file contains hidden or 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
class Hello | |
def world | |
puts 'Hello world!' | |
sleep 1 | |
end | |
end | |
SimpleMethodBenchmark.wrap! Hello, %i{world} | |
hello = Hello.new |
This file contains hidden or 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
var fs = require('fs'); | |
var pathJoin = require('path').join; | |
// Given a repo instance and a fs path, import the path (recursivly) and return | |
// the final root hash. Supports symlinks and executable files. | |
module.exports = function (repo, path, callback) { | |
return importPath(repo, path, function (err, stat) { | |
if (err) return callback(err); | |
return callback(null, stat.hash); | |
}); |
This file contains hidden or 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
(function () { | |
function Animal() {} | |
Object.defineProperties(Animal.prototype, { | |
noise: { | |
configurable: false, | |
enumerable: false, | |
value: null, | |
writable: false | |
} |
This file contains hidden or 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 <math.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#define BOOLEAN_FEEDBACK(boolean) ((boolean) ? "yes" : "no") | |
bool is_prime_clever(unsigned int number); | |
bool is_prime_naive(unsigned int number); | |
int main() { |
This file contains hidden or 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
require 'tire' | |
require 'nobrainer' | |
NoBrainer.connect 'rethinkdb://server/company' | |
class Employee | |
include NoBrainer::Document | |
field :name | |
field :title |