Skip to content

Instantly share code, notes, and snippets.

View ericktucto's full-sized avatar
😎
Happy

Erick Tucto ericktucto

😎
Happy
View GitHub Profile
@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
@rbialek
rbialek / config
Created June 7, 2011 13:32
ssh/.config
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa
@bert
bert / Makefile
Created July 18, 2011 21:07
GDA full example
CFLAGS = -Wall -g `pkg-config --cflags libgda-4.0`
LDFLAGS = `pkg-config --libs libgda-4.0`
example: example.c
$(CC) -o example example.c $(CFLAGS) $(LDFLAGS)
clean:
rm -f *~
rm -f *.o
rm -f example

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@cemerson
cemerson / hold.js
Created April 15, 2013 13:50
JavaScript: Touch/Click and Hold
var element;
document.addEventListener('touchstart', function(event) {
event.preventDefault();
var touch = event.touches[0];
element = document.elementFromPoint(touch.pageX,touch.pageY);
}, false);
document.addEventListener('touchmove', function(event) {
event.preventDefault();
var touch = event.touches[0];
@davidensinger
davidensinger / adding-open-graph-tags-to-jekyll.html
Last active April 9, 2025 14:56
Adding Open Graph Tags to Jekyll
<meta content="{{ site.title }}" property="og:site_name">
{% if page.title %}
<meta content="{{ page.title }}" property="og:title">
{% else %}
<meta content="{{ site.title }}" property="og:title">
{% endif %}
{% if page.title %}
<meta content="article" property="og:type">
{% else %}
<meta content="website" property="og:type">
@aras-p
aras-p / preprocessor_fun.h
Last active May 3, 2025 13:47
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@krakjoe
krakjoe / arrayof-perf.md
Last active September 11, 2020 17:05
arrayof-perf.md

Arrayof Performance

<?php
function arrayof_foo(Foo[] $fooze) {
    foreach ($fooze as $foo) {
    	$foo->bar();
    }
}
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 10, 2025 09:31
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@350d
350d / phpinfo.css
Created March 22, 2014 08:20
Styles for phpinfo();
html {
background: #fff;
margin:0;
padding:0;
}
body {
color: #233452;
height: 100%;
font-family: Verdana, Helvetica, sans-serif;
margin: 20px 0;