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
class FileInput < SimpleForm::Inputs::FileInput | |
def input_html_classes | |
super.delete_if { |k| k == 'form-control' } | |
end | |
end |
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 HelloWorld do | |
def say do | |
world_pid = spawn(HelloWorld, :world, []) | |
spawn(HelloWorld, :hello, [1000, world_pid]) | |
end | |
def hello(n, world_pid) when n > 0 do | |
IO.puts "Hello, " | |
world_pid <- {:world, Process.self} |
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
Instructions: | |
- Apply the patch | |
- Compile elixir | |
- Run the tests | |
$ git apply /path/to/patch.diff | |
$ make compile | |
$ ./bin/elixir native.ex > /tmp/native.ex | |
$ ./bin/elixir unicode.ex > /tmp/unicode.ex |
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 TCPServer do | |
def listen(port) do | |
tcp_options = [:list, {:packet, 0}, {:active, false}, {:reuseaddr, true}] | |
{:ok, l_socket} = :gen_tcp.listen(port, tcp_options) | |
do_listen(l_socket) | |
end | |
defp do_listen(l_socket) do | |
{:ok, socket} = :gen_tcp.accept(l_socket) |
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
diff --git a/lib/access.ex b/lib/access.ex | |
index 009fdf2..1b3d396 100644 | |
--- a/lib/access.ex | |
+++ b/lib/access.ex | |
@@ -27,6 +27,10 @@ defimpl Access, for: List do | |
atom_access(list, atom) | |
end | |
+ def access(list, binary) when is_binary(binary) do | |
+ atom_access(list, binary_to_atom(binary)) |
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
diff --git a/lib/file.ex b/lib/file.ex | |
index b64161c..b5715fd 100644 | |
--- a/lib/file.ex | |
+++ b/lib/file.ex | |
@@ -53,6 +53,41 @@ defmodule File do | |
FN.basename(path, extension) | |
end | |
+ @doc """ | |
+ Returns a string with one or more paths components joint by the path separator. |
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
# Class | |
snippet bc | |
var ${1:Thing} = Class.extend({ | |
initialize: function(${2:Attributes}) { | |
} | |
}); | |
# Model | |
snippet bbm | |
var ${1:Thing} = Backbone.Model.extend({ |
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
\documentclass[a4paper,11pt]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[portuguese]{babel} | |
\usepackage{graphicx} | |
\title{Mapeamento de Processo \\ Empresa Gatewaybox Tecnologia LTDA.} | |
\author{Gustavo Dutra \\ Patric dos Santos \\ Ronaldo Moreira \\ Eduardo Sarturi} | |
\begin{document} |
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/perl -w | |
{ | |
package CineFacade; | |
sub new { | |
my $this = {}; | |
my $class = shift; | |
$class = ref($class) || $class; | |
$this->{amplifier} = shift || undef; |
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
from django.http import HttpResponse,HttpResponseRedirect | |
from django.shortcuts import render_to_response | |
from crongd.accounts.forms import LoginForm | |
def root(request): | |
if request.user.is_authenticated(): | |
return HttpResponseRedirect('/account/profile') | |
else: | |
vars = {'user': request.user, 'loginForm': LoginForm()} | |
html = render_to_response('root.html',vars) |