Skip to content

Instantly share code, notes, and snippets.

@robmerrell
robmerrell / tictactoe.exs
Created November 29, 2014 23:31
Elixir Quiz TicTacToe solution
# solution for http://elixirquiz.github.io/2014-11-22-tic-tac-toe-part-1-the-game.html
defmodule Game do
defstruct board: [["_", "_", "_"], ["_", "_", "_"], ["_", "_", "_"]], # 3 x 3
current_player_pid: "",
previous_player_pid: ""
def draw_board(%Game{board: board}) do
Enum.each board, &IO.puts/1
end
@xdegtyarev
xdegtyarev / CompleteSharp.sublime-settings
Created November 10, 2012 19:44
CompleteSharp Unity3d config
{
// You probably want to configure this to something of your own.
// ${home}, ${env:<variable>}, ${project_path:} and ${folder:} tokens can be used in the completesharp_assemblies option.
//
// ${home} is replaced with the value of the HOME environment variable.
//
// ${env:<variable>} is replaced with the "variable" environment variable.
//
// ${project_path:} tries to find a file with the given name in all the registered project folders and
// returns the first file found, or the original file name if none is found.
@csanz
csanz / using_repl.md
Created August 1, 2011 09:07
Debugging your Mongoose Models Using Repl

Debugging your Mongoose Models Using Repl

This is a faster way to test your mongoose models. The example below was based on the expressjs-blog example here

Example

$node
> var mongoose = require('mongoose')
> var db = mongoose.connect('mongodb://localhost/blogsample')

> db.model('BlogPost', require('./app/models/blogpost'))

@karmi
karmi / workers.rake
Created July 22, 2010 15:58
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.
# Builds an iPhoneOS/Simulator compatible version of BoehmGC and packages
# it up into a "static framework" as per Landon Fuller's suggestion at
# http://landonf.bikemonkey.org/code/iphone/iPhone_Framework_Support.20081202.html
fail() {
echo $1 >&2
exit 1
}
clean() {