Skip to content

Instantly share code, notes, and snippets.

@litvil
litvil / install_elixir_phoenix.sh
Created February 23, 2020 23:34 — forked from ryanwinchester/install_elixir_phoenix.sh
Install Elixir and Phoenix on macOS
# Update brew
brew update
# Need postgres
brew install postgresql
# Install elixir
brew install elixir
# Install hex package manager
@litvil
litvil / recipe.example.md
Created April 26, 2019 18:51 — forked from peterbsmyth/recipe.example.md
Making chained API Calls using @ngrx/Effects

Making chained API Calls using @ngrx/Effects

Purpose

This recipe is useful for cooking up chained API calls as a result of a single action.

Description

In the below example, a single action called POST_REPO is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API:

  1. POST a new repostiry
  2. GET the master branch of the new repository
  3. GET the files on the master branch
#!/bin/sh
# view here:
# https://i.stack.imgur.com/OK3po.png
e=$'\e['
for n in {0..7}; do
printf "${e}"'38;05;'"${n}"'m%-6s' '('"$n"') '
done
@litvil
litvil / macosx_remove_java9.sh
Created October 25, 2017 15:22 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@litvil
litvil / gist:84662a0a4e50bee5a13f1626990ecc3c
Created March 27, 2017 02:04 — forked from bds/gist:2207826
Convert files from .scss to .sass
sass-convert -F scss -T sass application_styles.css.scss application_styles.css.sass
@litvil
litvil / deploy.rake
Created May 10, 2016 15:01 — forked from amejiarosario/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app, tail logs, ps, and more!
# rake deploy # Push app to heroku:production, migrate, restarts and tail logs
# rake deploy:production # Push app to production, migrate, restarts, tag and tail logs
# rake deploy:production:config # production config
# rake deploy:production:console # production console
# rake deploy:production:logs # production logs
# rake deploy:production:ps # production ps
# rake deploy:production:releases # production releases
# rake deploy:staging # Push app to staging, migrate, restarts, tag and tail logs
# rake deploy:staging:config # staging config
# rake deploy:staging:console # staging console

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh [email protected]

Add ssh fingerprint and enter password provided in email

@litvil
litvil / AS3 Shapes
Last active August 29, 2015 14:24 — forked from AlexHannigan/AS3 Shapes
package {
//import necessary classes
import flash.display.Sprite;
import flash.display.Graphics;
public class Circle extends Sprite {
private var canvas:Sprite = new Sprite();
private var gr:Graphics = canvas.graphics;