Find it here: https://github.com/bitemyapp/learnhaskell
This file contains hidden or 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
defmodule DBL.Message.Channel do | |
def subscribe([]), do: :ok | |
def subscribe([chan | rest]) do | |
case :pg2.join "stream/" <> chan, self do | |
{:error, {:no_such_group, _}} -> | |
:ok = :pg2.create "stream/" <> chan | |
:ok = :pg2.join "stream/" <> chan, self | |
:ok -> | |
:ok |
This file contains hidden or 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
// Block Grid | |
// Technique adapted from Foundation 5 for Bootstrap 3. | |
// https://github.com/zurb/foundation/blob/f755d8704123f86c281ede0b171881e2672f150d/scss/foundation/components/_block-grid.scss | |
// Original LESS Version by Christopher Mitchell (https://gist.github.com/ChrisTM) | |
// Converted to SCSS by Rasmus Jürs (https://github.com/Jursdotme) | |
[class*="block-grid-"] { | |
display: block; | |
margin: -($grid-gutter-width/2); | |
padding: 0; |
This file contains hidden or 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(auth_handler). | |
-compile({parse_transform, seqbind}). | |
-export([init/3, handle/2, terminate/2]). | |
-define(USERNAME, <<"admin">>). | |
-define(PASSWORD, <<"password">>). | |
%% public | |
init(_Transport, Req, []) -> |
This file contains hidden or 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
<% flash.each do |type, message| %> | |
<div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
<button class="close" data-dismiss="alert">×</button> | |
<%= message %> | |
</div> | |
<% end %> |
Enable ‘Run’ in the ‘Build’ section of your test bundle’s scheme. (See http://www.raingrove.com/2012/03/28/running-ocunit-and-specta-tests-from-command-line.html)
Install the Kicker tool and the dependencies
$ gem install kicker open4 colored xcodebuild-rb
This file contains hidden or 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
Pod::Spec.new do |s| | |
s.name = 'NULevelDB' | |
s.version = '0.0.1' | |
s.license = 'New BSD and custom BSD-like' | |
s.summary = 'NULevelDB is a Objective-C wrapper for Google\'s LevelDB.' | |
s.homepage = 'https://github.com/nulayer/NULevelDB' | |
s.author = { 'Brent Gulanowski' => 'FILL IN' } | |
s.source = { :git => 'https://github.com/nulayer/NULevelDB.git', :commit => '08b6d4c7a67bfd5fb58b4658d5d5da6ba821b0e0' } |
This file contains hidden or 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
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitWebGLEnabled"]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; |
This file contains hidden or 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
#!/bin/sh | |
# Create a RAM disk with same perms as mountpoint | |
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions | |
# Usage: sudo ./xcode_ramdisk.sh start | |
USERNAME=$(logname) | |
TMP_DIR="/private/tmp" | |
RUN_DIR="/var/run" | |
SYS_CACHES_DIR="/Library/Caches" |
This file contains hidden or 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
% snippet from pubsub_srv.erl | |
%----------- | |
start_link() -> | |
{ok,PID} = eredis_sub:start_link(), | |
register(eredispid,PID), | |
_Receiver = spawn_link(fun () -> | |
eredis_sub:controlling_process(PID), | |
receiver(PID) | |
end), | |
io:format("Eredis server started~n"), |