Skip to content

Instantly share code, notes, and snippets.

View zamith's full-sized avatar

Luís Ferreira zamith

View GitHub Profile
defmodule TheShelf.Mixfile do
use Mix.Project
def project do
[ app: :the_shelf,
version: "0.0.1",
elixir: "~> 1.0.0-rc1",
elixirc_paths: ["lib", "web", "test"],
deps: deps(Mix.env) ]
end
require "frank"
require "ecr"
require "ecr/macros"
get "/" do |context|
context.response.content_type = "text/html"
ECR.process_file("views/index.ecr")
end
@zamith
zamith / console
Last active August 29, 2015 14:13 — forked from anonymous/websocket.cr
var connection = new WebSocket('ws://127.0.0.1:3000')
connection.send("Hello World from WS")
@zamith
zamith / gist:08407aa767e890ee7a2d
Created November 26, 2014 16:08
rails-dev-box output
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty32'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Setting the name of the VM: rails-dev-box_default_1417017607283_37929
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
~/Projects/my-dotfiles/vim/ftplugin/markdown.vim
110: /usr/local/Cellar/vim/7.4.253/share/vim/vim74/ftplugin/markdown.vim
111: ~/Projects/my-dotfiles/vim/bundle/vim-snipmate/ftplugin/html_snip_helper.vim
112: /usr/local/Cellar/vim/7.4.253/share/vim/vim74/ftplugin/html.vim
113: ~/Projects/my-dotfiles/vim/bundle/syntastic/autoload/syntastic/log.vim
114: ~/Projects/my-dotfiles/vim/bundle/ctrlp.vim/autoload/ctrlp/utils.vim
115: ~/Projects/my-dotfiles/vim/ftplugin/html.vim
(ns layouts.application
(:require [hiccup.page :as h]
[hourglass.helpers :as misc]))
(defn layout [page]
(h/html5
misc/pretty-head
(misc/pretty-body page)))
(defn home []
def track_event_on_mixpanel
Resque.enqueue MixpanelTrackEventJob, "Event", properties, env
end
class UserMailer {
private $user;
public function __construct($user)
{
$this->user = $user;
}
public function activation_deliver()
{
<?php
class UserMailer {
private $user = null;
public function __construct(user)
{
$this->$user = user;
}
#include <stdio.h>
void print_ages(int age) {
int i;
int number_of_trips = 0;
for (i = 0; i <= age; i++)
{
if(i % 8 == 0 && i % 5 != 0) {
printf("%i\n", i);
number_of_trips++;