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(thear). | |
-export([simplify/1]). | |
-spec simplify (E) -> E when E::term(). | |
simplify (E) -> | |
S = fun | |
({add,E1,{num,0}}) -> | |
S(E1); |
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
# For rπ only: -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard | |
git clone git@github.com:ckolivas/cgminer.git cgminer.git | |
cd cgminer.git/ | |
git checkout v4.2.3 # The latest | |
./autogen.sh | |
CFLAGS="-O2 -Wall -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" ./configure --enable-bflsc | |
CXXFLAGS="-O2 -Wall -march=armv6zk -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" make | |
sudo ./cgminer -o stratum+tcp://eu-stratum.btcguild.com:3333 -u radioxid_monolith -p 123b |
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(propfolding). | |
-export([get/1]). | |
get (Doc) -> | |
{Stars, AreaID, CheckinDate, HotelID, Rooms} = | |
lists:foldl( | |
fun | |
({<<"stars">>, Stars}, Acc) -> setelement(1, Acc, Stars); | |
({<<"areaID">>, AreaID}, Acc) -> setelement(2, Acc, AreaID); | |
({<<"checkinDate">>, <<Year:4, $-, Month:2, $-, Day:2>>}, Acc) -> |
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
%% -*- coding: utf-8 -*- | |
-module(wat_clauses). | |
%% wat_clauses: | |
%% a warning should be emitted as 2nd clause will never match (given 1st clause) | |
-export([authenticate_nouns/1]). | |
%% API |
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 python2 | |
import re | |
import sys | |
fn = sys.argv[1] | |
lines = [line.rstrip('\n') for line in open(fn)] | |
def get_callid(line): |
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
scanning "applications/omnipresence/ebin/omnip_sup.beam" | |
warn_behaviour omnip_sup.erl:58: The return type {'ok',{_,[{_,{atom() | tuple(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom() | tuple()]}]}} in the specification of init/1 is not a subtype of 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),non_neg_integer()} | {'one_for_one',non_neg_integer(),non_neg_integer()} | {'rest_for_one',non_neg_integer(),non_neg_integer()} | {'simple_one_for_one',non_neg_integer(),non_neg_integer()},[{_,{atom() | tuple(),atom(),'undefined' | [any()]},'permanent' | 'temporary' | 'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor' | 'worker','dynamic' | [atom() | tuple()]}]}}, which is the expected return type for the callback of supervisor behaviour | |
1 Dialyzer warnings | |
Somewhat easier to read: | |
{ok,{'_',[{'_',{atom,'|',tuple,atom,undefined,'|',[any]}, | |
permanent |
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/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/sceaga/homebrew/tarball/tiger anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" end |
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
<?xml version='1.0' encoding='utf-8'?> | |
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> | |
<soap:Body> | |
<SearchTelephoneNumbersResponse xmlns='http://www.bandwidth.com'> | |
<SearchTelephoneNumbersResult> | |
<a> | |
text out | |
<mytext ishere="text in"/> | |
</a> | |
<TelephoneNumber id="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
char **ifs_split(const char *str, const char *ifs) | |
{ | |
size_t index = 0; | |
size_t size = 1; | |
char *segment = NULL; | |
char *start = NULL; | |
char *rest = NULL; | |
char **tab = NULL; // Thou shall free thee. | |
start = dupstr(str); |
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(my_tests). | |
-include_lib("eunit/include/eunit.hrl"). | |
e_test () -> | |
{setup, fun () -> ok end, | |
fun () -> ok end, | |
fun () -> {inorder, [ | |
?_assertMatch(fail, hard) %% Does not fail! | |
]} end}. |
OlderNewer