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
export HISTCONTROL=erasedups | |
export HISTSIZE=500 | |
export HISTIGNORE=ls:'ls -l':fg |
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
ack | |
bundle | |
cat | |
cd | |
cd- | |
ceedling | |
cp | |
curl | |
diff | |
find |
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
res = File.read("/usr/share/dict/words").lines.map{|l| l.chomp.downcase}.inject({}) do |cont, w| | |
a = w.tr('aeiou', '') | |
cont.tap do |h| | |
h[a] ||= [] | |
h[a] << w | |
end | |
end | |
most = res.map {|k, v| [k, v.length]}.sort_by {|a| a[1]}.reverse[0][0] | |
puts "Most commonly used abbreviation: '#{most}' with #{res[most].length} words." |
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 | |
def stats(b, c, t) | |
puts "Byte: #{b} | Count: #{c} | #{Time.now - t}" | |
end | |
MOD_VAL = 255 | |
start = Time.now | |
last = 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
import Data.Monoid | |
import Data.Maybe | |
main :: IO () | |
main = do | |
print $ expression | |
instance Monoid Integer where | |
mempty = 0 | |
mappend = (+) |
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 <stdio.h> | |
#include <stdlib.h> | |
#define IGNORE(X) ((void)X) | |
#define MAX_ALLOC (1024 * 1024) | |
#define MIN_ALLOC (128) | |
int main(int argc, char * argv[]) { | |
IGNORE(argc); | |
IGNORE(argv); |
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 <stdio.h> | |
int main(int argc, char * argv[]) { | |
float wat = 1.0 / 0.0; | |
printf("%f\n", wat); | |
return 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
#include <stdio.h> | |
typedef int (binop)(int a, int b); | |
int add(int a, int b); | |
int sub(int a, int b); | |
int mul(int a, int b); | |
int div(int a, int b); | |
int do_op(int a, int b, binop op); |
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
module Main where | |
main :: IO () | |
main = print $ example | |
-- The binary tree type. | |
data Tree a = Tree a (Tree a) (Tree a) | Nil | |
deriving (Show) | |
-- Breadth-first traversal |
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
#ifndef ManualProfiler_h | |
#define ManualProfiler_h | |
#include <stdio.h> | |
#include <stdint.h> | |
typedef uint64_t (MPSampleTime)(void * param); | |
struct MPProfiler { | |
FILE * profileLog; |