Skip to content

Instantly share code, notes, and snippets.

View BillBarnhill's full-sized avatar
💭
Learning Rust

=Bill.Barnhill BillBarnhill

💭
Learning Rust
View GitHub Profile
@BillBarnhill
BillBarnhill / hipchat_bot.js
Created April 28, 2011 18:25 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@ewilderj
ewilderj / gist:1552777
Created January 3, 2012 00:22
Add dependency to DOAP
=== modified file doap/schema/doap.rdf
--- doap/schema/doap.rdf 2009-06-25 16:32:08 +0000
+++ doap/schema/doap.rdf 2010-07-30 14:41:53 +0000
@@ -390,6 +390,19 @@
<rdfs:domain rdf:resource="http://usefulinc.com/ns/doap#Project" />
</rdf:Property>
+<rdf:Property rdf:about="http://usefulinc.com/ns/doap#dependency">
+ <rdfs:isDefinedBy rdf:resource="http://usefulinc.com/ns/doap#" />
+ <rdfs:label xml:lang="en">dependency</rdfs:label>
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
#
# http://www.devthought.com/2009/09/19/get-ssh-copy-id-in-mac-os-x/
#
@zambal
zambal / gist:5792462
Last active December 18, 2015 13:49
Enum with lots of sugar
defmodule Enex do
defmacro map enum, clauses do
fnc = {:fn, [], [clauses]}
quote do: Enum.map(unquote(enum), unquote(fnc))
end
defmacro reduce enum, acc, clauses do
fnc = {:fn, [], [clauses]}
quote do: Enum.reduce(unquote(enum), unquote(acc), unquote(fnc))
end
@shallowlong
shallowlong / [Android] Handler (Advanced)
Last active January 2, 2016 23:58
The advanced handler to set the runnable task and set time postpond
// the advanced handler will allow to postpone for a given time.
// instead of using the java.lang.Thread class, the new class is java.lang.Runnable class
android.os.Handler.Handler
android.os.Message
java.lang.Runnable
Handler msgHandler = new Handler() {
@Override
private AtomicReferenceArray<Thread> consumerWorker;
@Override
public void block() throws InterruptedException {
boolean parked=false;
for(int index=0;index<consumer;index++)
{
if(consumerWorker.get(index)==null && consumerWorker.compareAndSet(index, null, Thread.currentThread()))
@padde
padde / mutate.exs
Created March 24, 2015 06:25
Stream.mutate/3
defmodule MyStream do
def mutate(enum, user_acc, user) do
step = fn val, _acc -> {:suspend, val} end
next = &Enumerable.reduce(enum, &1, step)
&do_mutate([], user_acc, user, next, &1, &2)
end
defp do_mutate(values, user_acc, user, next, {:suspend, acc}, fun) do
{:suspended, acc, &do_mutate(values, user_acc, user, next, &1, fun)}
end
@imminent
imminent / CursorSubject.java
Last active August 11, 2016 17:21
CursorSubject is a Reactive Extension version of Android's CursorLoader. Handles retrieving the Cursor in a background thread, sending the result Cursor on the main thread, and resending a Cursor whenever the content changed notification is triggered.
package com.example.models;
import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Handler;
import android.os.Looper;
import java.io.Closeable;
import java.util.concurrent.atomic.AtomicReference;
@BillBarnhill
BillBarnhill / japan-mythical_creatures.txt
Created September 4, 2016 13:52 — forked from seaofclouds/japan-mythical_creatures.txt
A long list of Japanese Mythical Creatures
Inspired by VividDreams' topic: "Mythical Creatures A-Z"
source: http://www.animationsource.org/board/japanese-mythical-creatures-t14593.html
A
* Abumi-guchi - a furry creature formed from the stirrup of a mounted military commander
* Abura-akago - an infant ghost who licks the oil out of andon lamps
* Abura-bō - a spook fire from Shiga Prefecture, in which the shape of a monk can often be seen
* Abura-sumashi - a spirit who lives on a mountain pass in Kumamoto Prefecture
* Akabeko - a red cow involved in the construction of Enzō-ji in Yanaizu, Fukushima

Debugging Erlang Applications In Real Time

Reid Draper @reiddraper

We'll be using a tool called redbug, which is an abstraction and safety layer of Erlang's built-in dbg tracing facilities. You can follow along at home: