Skip to content

Instantly share code, notes, and snippets.

View hugooliveirad's full-sized avatar

Hugo de Oliveira hugooliveirad

View GitHub Profile
import { createMachine, assign } from "xstate";
type MachineContext = {
lives: number;
};
type MachineEvent =
| { type: "IDLE" }
| { type: "WALK" }
| { type: "RUN" }
@hugooliveirad
hugooliveirad / nefToJpeg.sh
Last active February 24, 2021 00:29
Convert RAW images (.NEF) to jpeg and create shareble versions
#!/bin/bash
# create folders. Ensure your directory is writable
mkdir -p jpegs/share;
# loops .NEF files in this directory. Subdirectories aren't supported
for f in *.NEF;
do
# gets filename and inserts .jpg at the end
@hugooliveirad
hugooliveirad / TerminalPranks.md
Last active January 24, 2021 07:00
Terminal Pranks

Use without caution

while :; do echo "I will kill you later" | say -v Whisper; sleep 50; done &
<?xml version="1.0" encoding="UTF-8"?>
<!-- TeXML files must contain the Response element -->
<Response>
<!-- Say and Dial are Verbs -->
<Say>Thank you for calling Telnyx.</Say>
<Dial>
<Sip>sip:gencredhoj84HXAATNAXTfLJBkZBFv0sr@sip.telnyx.com</Sip>
</Dial>
</Response>
@hugooliveirad
hugooliveirad / readme.md
Created May 18, 2015 18:30
Diff two command outputs (stdout) without using files
@hugooliveirad
hugooliveirad / git-useful.md
Last active December 5, 2019 16:27
git-useful

git-useful

a collection of useful commands to use Git and GitHub.

Add

add files interactively

git add <file> --patch

# working example
@hugooliveirad
hugooliveirad / git-aliases.sh
Last active February 25, 2019 14:15
Git Aliases
# Mais usados --
alias ga="git add"
alias gc="git commit -m"
alias gca="git commit -am"
alias gs="git status"
alias gp="git push"
alias gpl="git pull"
# Diff --
alias gd="git diff"
@hugooliveirad
hugooliveirad / connect-cljs.repl.md
Created October 8, 2015 13:01
Connect to ClojureScript Node nREPL

jack-in into normal Clojure nREPL. Run:

(require '[cljs.repl :as repl] '[cljs.repl.node :as node])

(compile 'cljs.repl.node)

(cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env))
@hugooliveirad
hugooliveirad / rsync-from-ftp.sh
Last active June 21, 2018 14:11
Rsync from FTP server
# Mounts FTP server
open -a Finder ftp://login:password@ftp_host/path
# Rsync from there (add --dry-run option to simulate transfer)
rsync -arvz --no-o --no-g /Volumes/ftp_host/path/ ./
# WIN!
@hugooliveirad
hugooliveirad / git-sync-fork.sh
Created February 21, 2014 21:33
Sync Fork On GitHub
# Sync fork with original repository
#
# Requires an "upstream" remote, pointing to original repo
# e.g. `git remote add upstream git@github.com:user/repo.git`
alias git-sync-fork="git fetch upstream; git checkout master; git merge upstream/master"