This file contains 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 WhateverWeb.AController do | |
use WhateverWeb, :controller | |
# get "/whatever/:format", WhateverWeb.AController, :some_action | |
def some_action(conn, %{"format" => "xml"} = _params) do | |
example_data = %{ | |
name: "Buy Guy", | |
title: "buyer", | |
items: [ | |
%{name: "A", cost: 10, qty: 1}, |
This file contains 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; :RAZZLE_DAZZLE | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(def #'generate-faux-lisp | |
method_missing (*lol, &block) | |
((block. call) unless | |
(block. nil?)) | |
end) | |
(you :know, i |
This file contains 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
$ cat ~/bin/vigrep | |
#!/bin/sh | |
# open all files containing grep results in vi | |
# usage: | |
# vigrep term directory/ | |
vi $( grep -R $1 $2 | sed 's/:.*//' | uniq | xargs echo ) |
This file contains 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
#!/usr/bin/env ruby | |
# this is a build script for corona iphone applications (www.anscamobile.com) | |
# | |
# it will combine all lua files and any images inside an image directory into | |
# a project that you can then build for a device with the corona simulator | |
# | |
# the resulting combined project is put inside the build directory | |
# | |
# simply put the file inside your current corona project and run it with | |
# ruby build.rb |