Skip to content

Instantly share code, notes, and snippets.

View jonatasnona's full-sized avatar
🇧🇷
Working from home

Jonatas Pedraza jonatasnona

🇧🇷
Working from home
View GitHub Profile
@jonatasnona
jonatasnona / key-fingerprint
Created March 7, 2012 18:45 — forked from yosemitebandit/key-fingerprint
SSH: print ssh public key's fingerprint
$ ssh-keygen -l -f id_rsa.pub
2048 aa:bb:cc:dd:ee:ff:00:11:22:33:44:55:66:77:88:99 id_rsa.pub (RSA)
@jonatasnona
jonatasnona / pre-commit
Created November 22, 2012 13:38 — forked from mrkschan/pre-commit
a pre-commit hook for git to remove trailing whitespace
#!/bin/sh
#
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
# Ref - http://is.gd/PerowD
#
if git rev-parse --verify HEAD >/dev/null 2>&1
then
@jonatasnona
jonatasnona / C: Consumer Producer
Created April 12, 2013 13:05
implementação do problema de threads consumidor/produtor
// arquivo: prodcons.c
// descricao: Programa produtor-consumidor com mutex
// Utiliza a biblioteca pthreads.
// para compilar: cc -o phtread pthread.c -lpthread
#include <pthread.h>
#define FALSE 0
#define TRUE 1
@jonatasnona
jonatasnona / frontend-templating.md
Created October 22, 2012 13:32
Front-end Templating

Front-end templating

Introduction

Using the concept of templating in the browser is becoming more and more wide-spread. Probably the main reason to this is the move of application logic from the server to the client, in tandem with the increasing usage of the MVC pattern. Templates can be extremely useful in client-side development, especially to separate markup and logic in views.

There are plenty of definitions of the term "template", here is a good one from foldoc (http://foldoc.org/template):

A document that contains parameters, identified by some special syntax, that are replaced by actual arguments by the template processing system.

@jonatasnona
jonatasnona / README.md
Created May 24, 2019 01:17 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@jonatasnona
jonatasnona / gist:2625083
Created May 7, 2012 00:07
APT: Removing broken packages in a bad inconsistent state
# rm /var/lib/dpkg/info/flashplugin-nonfree.prerm
# dpkg --remove --force-remove-reinstreq <package>
@jonatasnona
jonatasnona / iterm2.md
Created February 14, 2019 18:18 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@jonatasnona
jonatasnona / gist:4051335
Created November 10, 2012 15:04
VIM: Navigation Commands
[Navigation: File]
Ctrl-f #page down
Ctrl-b #page up
Ctrl-d #half page down
Ctrl-u #half page up
Shift-g #end of the file
g #top of the file
Shift-h #top of screen view
Shift-m #middle of screen view
@jonatasnona
jonatasnona / tmux-cheatsheet.markdown
Created February 24, 2018 03:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname