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
> module Main where | |
First, import all the needed modules. | |
> import Text.Parsec hiding (State) | |
> import Text.Parsec.Indent | |
> import Control.Monad.State | |
Next, define our new Parser type. This replaces the Identity monad | |
with the (State SourcePos) monad. |
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
describe "thing" do | |
before do | |
@obj_1 = Object.new | |
@obj_2 = Object.new | |
stub(@obj_1).foo { puts "stubbed foo (1)" } | |
stub(@obj_2).foo { puts "stubbed foo (2)" } | |
end | |
it "1 does things" do | |
mock(@obj_1).foo { puts "mocked foo (1)" } |
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
#include <assert.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <time.h> |
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 <stdint.h> | |
#define STACKY_LEN (1024 * STACKY_MULT) | |
int main(int argc, char * argv[]) { | |
(void)argc; | |
(void)argv; | |
#ifndef GOTTA_GO_FAST | |
uint8_t const stacky[STACKY_LEN] = { |
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 <assert.h> | |
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
struct xbee_enc_state { | |
uint8_t const * input; | |
size_t size; |
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
local a = function () | |
print("i am a") | |
end | |
error("no") | |
return a |
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
# To install prerequisites for this sample code, run | |
# the following commands in a directory with all the | |
# files in this gist: | |
# | |
# > gem install bundler | |
# > bundler install | |
source "http://rubygems.org/" | |
gem "thor", "0.15.4" |
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 python | |
import sys | |
import os | |
import hashlib | |
ALIGN = 256 | |
for f in sys.argv[1:]: | |
if os.path.isfile(f): |
NewerOlder