Skip to content

Instantly share code, notes, and snippets.

View sleepiecappy's full-sized avatar

Evangelista sleepiecappy

View GitHub Profile
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.3
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
# Plugins
asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add nodejs
asdf plugin-add java
asdf install erlang 20.3
asdf install elixir 1.6.5

Keybase proof

I hereby claim:

  • I am sleepiejohn on github.
  • I am sleepiejohn (https://keybase.io/sleepiejohn) on keybase.
  • I have a public key ASCjgGDL2z4oHgrrEGVnyiyi3F_qxRg9rdnsj3GReJ5l3wo

To claim this, I am signing this object:

@sleepiecappy
sleepiecappy / elixir.json
Created April 15, 2018 03:49
elixir snippets for vscode
{
"def": {
"prefix": "def",
"body": [
"def $1($2) do",
" $0",
"end"
],
"description": "Default function declaration"
},
defmodule Worker do
@moduledoc File.read!("README.md")
def work() do
end
end
@sleepiecappy
sleepiecappy / mix.aliases.exs
Last active March 28, 2018 21:38
Handy aliases for mix projects
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"],
# handy tasks grouped to easy the start of the project
hack: ["deps.get", "compile", "ecto.setup"],
# CI installation steps as one command
"ci.install": [
"local.hex --force",
@sleepiecappy
sleepiecappy / .editorconfig
Created March 11, 2018 14:32 — forked from eksperimental/.editorconfig
.editorconfig for Elixir projects
# EditorConfig is awesome: http://EditorConfig.org
# .editorconfig for Elixir projects
# https://git.io/elixir-editorconfig
# top-most EditorConfig file
root = true
[*]
indent_style = space
actice
Linked List Practice
Here's one answer—how does it compare to yours?
class Element(object):
def __init__(self, value):
self.value = value
self.next = None
defmodule Valkyrie.Processes do
@moduledoc """
Operations to perform using processes, note that this implementation
is for local processes, for remote ones look at:
`Valkyrie.Remoting.Processes`
"""
# TODO kill a process softly or hard
@doc """
@sleepiecappy
sleepiecappy / Tuple.java
Created February 7, 2018 03:56
A simple length variable Tuple implementation with safe access and typed
package com.example;
/**
* A simple length variable Tuple implementation with safe access and typed
*
* Usage example:
* Tuple<Integer> ints = new Tuple<>(1, 2, 3, 5);
* ints.at(3); // 5
* ints.at(6); // null
**/
@sleepiecappy
sleepiecappy / pyenv.ps1
Last active December 7, 2017 21:10
Powershell script to create a conda env with necessary packages and support pip declaration in one line
# Usage: pyenv -name myenv -pyver 3.6 -conda pandas,numpy,scipy -pip tensorflow,matplotlib
param(
[Parameter(Mandatory=$true)][String]$name, # the name of new env
[String]$pyver = "3.6", # the python version defaults to 3.6
[String[]]$pip, # comma separated list of packages to install with pip
[String[]]$conda, # comma separated list of packages to install with conda
[bool]$mkdir=$true # create a directory for the project
)
$condaPkgs = [system.String]::Join(" ", $conda)