Skip to content

Instantly share code, notes, and snippets.

View hugooliveirad's full-sized avatar

Hugo de Oliveira hugooliveirad

View GitHub Profile

Tweet selected text

When a user selects a text, display a simple button to tweet that text. Maybe will evolve to a JavaScript plugin.

A Pen by Hugo on CodePen.

License.

@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
Tracker =
###
Sends Analytics events
@param {String}
@param {String}
@param {String}
@returns {Tracker}
###
trackEvent: (category, action, label) ->
[
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }
]
@hugooliveirad
hugooliveirad / README.md
Last active January 4, 2016 21:29
Highlight copied code for keynote presentations

Highlight Clipboard

highlights clipboard code for Keynote presentations

Why?

If you are presenting code, you should do this as text, as people could copy it after you share your slides. There is no option for code in Keynote, so here is a simple way to do this.

@hugooliveirad
hugooliveirad / find-exec-thumbs.sh
Created January 31, 2014 14:28
Find WordPress generated thumbnails and execute a command
# Becareful! This is not tested with every kind of names and isn't ok to use in production.
# So, never execute rm in these files. Please. Or the world will end.
#
# Be sure to run this command in wp-content/uploads.
# Please comment if any strange behavior.
# creates backup folder
mkdir -p ~/bkp
# finds thumbs and move then to ~/bkp. You can run any command after the -exec flag.
@hugooliveirad
hugooliveirad / git-ahead-behind.sh
Last active August 29, 2015 13:55
Git ahead and behind info
# add this function to your .bash_profile to be able to use it everywhere
# usage: git-ahead-behind [local-branch] [remote-branch]
function git-ahead-behind() {
branch="`git symbolic-ref --short -q HEAD`";
loc="${1-$branch}";
remote="${2-origin/$loc}";
git fetch $remote &> /dev/null
wait
@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 [email protected]:user/repo.git`
alias git-sync-fork="git fetch upstream; git checkout master; git merge upstream/master"
@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 / 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