Skip to content

Instantly share code, notes, and snippets.

View cstorey's full-sized avatar

cstorey

View GitHub Profile
@andelf
andelf / beam_decompile.erl
Created March 19, 2013 03:25
Erlang BEAM file decompile to .erl file
#!/usr/bin/env escript
% -*- mode: erlang -*-
main([BeamFile]) ->
{ok,{_,[{abstract_code,{_,AC}}]}} = beam_lib:chunks(BeamFile,[abstract_code]),
io:fwrite("~s~n", [erl_prettypr:format(erl_syntax:form_list(AC))]).
@roidrage
roidrage / wrap.rb
Last active May 3, 2018 04:46
A simple wrapper that forks off a child and prints out a progress dot every X seconds
#!/usr/bin/env ruby
pid = Kernel.fork do
`#{ARGV.join(" ")}`
exit
end
trap(:CHLD) do
print "\n"
exit
NewPersonValidator = Validator.define do
validates_presence_of :name
end
class Person
attr_accessor :name
def initialize(name); @name = name; end
end
person = Person.new("Frank")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@quchen
quchen / trolling_haskell
Last active November 12, 2024 00:10
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@mergeconflict
mergeconflict / BlockingQueue.java
Last active December 15, 2015 21:58
Queue based on Hinze-Paterson 2-3 finger trees (http://www.soi.city.ac.uk/~ross/papers/FingerTree.pdf), BlockingQueue based on AtomicReference and a counting Semaphore.
package mergeconflict.collection.concurrent;
import java.util.concurrent.Semaphore;
import java.util.concurrent.atomic.AtomicReference;
import mergeconflict.collection.immutable.Queue;
public class BlockingQueue<E> {
private final Semaphore s = new Semaphore(0);
private final AtomicReference<Queue<E>> q = new AtomicReference<Queue<E>>(Queue.<E> empty());
@okapies
okapies / promises-are-functional.md
Last active August 14, 2023 11:44
翻訳: ”命令型のコールバック、関数型のプロミス: Node が逸した最大の機会” by James Coglan

命令型のコールバック、関数型のプロミス: Node が逸した最大の機会

Original: "Callbacks are imperative, promises are functional: Node's biggest missed opportunity" by James Coglan

Translated by Yuta Okamoto (@okapies)

Note

  • 訳者は JavaScript や Node.js に関する専門知識がほとんどありません。識者のツッコミをお待ちしております。「◯◯が分からない」等も歓迎です。
  • 元記事から構成を一部変更しています。また、関数型プログラミングに関する記述のうち、議論の骨子に絡まないものは省略しています。
@macintux
macintux / gist:5418295
Last active December 16, 2015 10:09
Draft of a blog post (or possibly a series of posts) diving into the meat of several key Riak configuration parameters. Internal links do not work, but I haven't worried about that since I'm not sure how closely GFM maps to Basho's blogging platform.
@juliepagano
juliepagano / 101_off_limits.md
Last active December 16, 2020 09:37
101 conversations I generally don't want to have...

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.

@chriseidhof
chriseidhof / Futamura.lhs
Last active April 17, 2017 18:44
Futamura projections
In this article, we we will look at the first three Futamura projections.
> module Futamura where
Suppose we have a program datatype, which takes input to output. This could be
any kind of executable program:§
> data Program i o = Program i o
It is accompanied by an `exec` function which executes the program, and given an