Skip to content

Instantly share code, notes, and snippets.

View leandrocp's full-sized avatar

Leandro Pereira leandrocp

View GitHub Profile
@joshnuss
joshnuss / multi_task.exs
Last active May 10, 2019 14:05
Module for running multiple tasks
defmodule MultiTask do
@moduledoc "Tools for running multiple tasks simultaneously"
@spec async([fun]) :: Task.t
@doc "Start multiple tasks asynchronously"
def async(tasks) do
Enum.map(tasks, &Task.async/1)
end
@spec await([Task.t]) :: [term]
@mmcc
mmcc / install-docker-mint.sh
Last active October 17, 2022 19:52 — forked from sirkkalap/Install-Docker-on-Linux-Mint.sh
Install Docker on Linux Mint 17
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sh -c 'echo deb https://apt.dockerproject.org/repo ubuntu-trusty main > /etc/apt/sources.list.d/docker.list'
# Install docker
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get install docker-engine
sudo service docker start
@taybin
taybin / gist:22f13ad1a5c90db23e6a
Last active October 19, 2015 09:59
ecto many to many association
defmodule Foo.Model.Job do
alias Foo.Model.JobToJob, as: JobToJob
use Ecto.Model
schema "jobs" do
field :name, :string
has_many :children, JobToJob, foreign_key: :parent_id
has_many :parents, JobToJob, foreign_key: :child_id
end
end
# WebLogic Connection
adminUserName='weblogic'
adminPassword='welcome1'
adminURL='t3://localhost:7001'
# DataSource Details
dsName='TestDS'
dsJNDIName='jdbc/test'
dsDriverName='com.mysql.jdbc.Driver'
dsURL='jdbc:mysql://localhost:3306/mysql'
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@imathis
imathis / gist_tag.rb
Created June 15, 2011 17:58 — forked from chrisjacob/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@dcrec1
dcrec1 / centos
Last active March 24, 2017 11:52
ubuntu/centos nginx
cd /tmp
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
rpm -Uhv rpmforge-release*.rf.i386.rpm
yum install readline-dev htop