Skip to content

Instantly share code, notes, and snippets.

;;; prelude-osx.el --- Emacs Prelude: OSX specific settings.
;;
;; Copyright © 2011-2015 Bozhidar Batsov
;;
;; Author: Bozhidar Batsov <bozhidar@batsov.com>
;; URL: https://github.com/bbatsov/prelude
;; Version: 1.0.0
;; Keywords: convenience
;; This file is not part of GNU Emacs.
@bradfordw
bradfordw / hardwork.sh
Last active November 4, 2015 21:46 — forked from robertoaloi/hardwork.sh
Count the number of lines of an Erlang application (excluding comments, type specs, empty lines).
# for osx users
find . -type f \( -name "*.erl" -or -name "*.hrl" -or -name "*.app.src" \) -exec cat {} \; | sed '/^\s*$/d;/^\s*\%\%/d;/^\-spec*/d' | wc -l
#!/bin/bash
pbpaste | xmllint --format -
exit 0
[
{
"id": 100,
"url": "http://en.wikipedia.org/wiki/Salmonidae"
}
]
[erlang-solutions]
name=Centos $releasever - $basearch - Erlang Solutions
baseurl=http://packages.erlang-solutions.com/rpm/centos/6/$basearch
gpgcheck=1
gpgkey=http://packages.erlang-solutions.com/rpm/erlang_solutions.asc
enabled=1
[{"name": null,"first_name": null,"last_name": null,"birth_city": null,"birth_state": null,"birth_country": null,"birth_date": null,"college": null,"draft_team": null,"draft_round": null,"draft_pick": null,"draft_year": null,"position": null,"height": null,"weight": null,"death_date": null,"death_city": null,"death_state": null,"death_country": null,"year_start": null,"year_end":null}]
# Wonder which is nodejs and which is erlang...
# erlang node was running on only 2 schedulers instead of the 8 available
bwinfrey:~ $ siege -c 25 -i -b --time=1M -f URLS
** SIEGE 2.71
** Preparing 25 concurrent users for battle.
The server is now under siege...[alert] socket: 125456384 select timed out: Operation timed out
[alert] socket: 124383232 select timed out: Operation timed out
[alert] socket: 124919808 select timed out: Operation timed out
[alert] socket: 131358720 select timed out: Operation timed out
MySQL
create table webmasters (
id int(11) unsigned primary key auto_increment not null,
email varchar(255) not null,
password varchar(255) not null);
create table stats (
id int(11) unsigned primary key auto_increment not null,
webmaster_id int(11) unsigned not null,
widget_id int(11) unsigned not null,

Keybase proof

I hereby claim:

  • I am bradfordw on github.
  • I am bradfordw (https://keybase.io/bradfordw) on keybase.
  • I have a public key whose fingerprint is DA3A 7145 D8F4 5010 1EF6 573C EF2B DA50 F24F 85A7

To claim this, I am signing this object:

-module(exp_parser).
-export([parse/1]).
% Parse simple math expressions.
% Currently works (for certain definitions of "works")
% for addition, subtraction and multiplication.
% Eventually it should handle a unary negation operator (~)
% The goal is to do the following:
% parse("(2 + 3)") => {plus, {num, 2}, {num, 3}}