Skip to content

Instantly share code, notes, and snippets.

View poacosta's full-sized avatar
:atom:
ἐρευνητής

Pedro Orlando Acosta Pereira poacosta

:atom:
ἐρευνητής
View GitHub Profile
@ck3g
ck3g / example.ex
Created February 14, 2019 16:14
How to read from STDIN in Elixir (for HackerRank)
defmodule Solution do
#Enter your code here. Read input from STDIN. Print output to STDOUT
end
array_length = IO.read(:stdio, :line)
array = IO.read(:stdio, :line)
array_length
|> String.trim
|> String.to_integer
@cagcak
cagcak / postman_install.sh
Created July 26, 2018 06:20 — forked from oleg-sh-test/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@iangreenleaf
iangreenleaf / gist:b206d09c587e8fc6399e
Last active April 24, 2025 04:34
Rails naming conventions

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@gerardorochin
gerardorochin / rfc regex
Created June 6, 2013 00:00
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/
@genericsteele
genericsteele / state_hash.rb
Created March 27, 2012 13:37
A ruby hash of US states
def state_hash
{"Alabama" => "AL",
"Alaska" => "AK",
"Arizona" => "AZ",
"Arkansas" => "AR",
"California" => "CA",
"Colorado" => "CO",
"Connecticut" => "CT",
"Delaware" => "DE",
"District of Columbia" => "DC",