Skip to content

Instantly share code, notes, and snippets.

View gilbertoca's full-sized avatar

Gilberto Caetano de Andrade gilbertoca

View GitHub Profile
@gilbertoca
gilbertoca / gitblit_on_opensuse
Last active July 13, 2016 15:13
Manual install of the GitBlit project on openSUSE
#folder structure
#GITBLIT_PATH=/opt/gitblit/app/[VERSION]
#GITBLIT_BASE_FOLDER=/opt/gitblit/data
#GITBLIT_HTTP_PORT=0
#GITBLIT_HTTPS_PORT=8443
#GITBLIT_LOG=/opt/gitblit/app/[VERSION]/gitblit.log
#run as gitblit user
groupadd gitblit
useradd -g gitblit -d /opt/gitblit gitblit
@hofnerb
hofnerb / Undoing_Merges.md
Created April 9, 2015 16:15
Undoing Merges

Undoing the last (local) merge (and thus rewriting the history):

git reset --hard HEAD~

Reverting last commit (commits the commit of mainline before the last commit again)

git revert -m 1 HEAD
@dedunumax
dedunumax / .gitignore Java
Last active April 6, 2024 16:13
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@Kartones
Kartones / postgres-cheatsheet.md
Last active April 30, 2024 19:47
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@floralvikings
floralvikings / AutoCompleteTextBox.java
Last active December 30, 2023 04:41
Simple JavaFX TextBox with AutoComplete functionality based on a supplied set.
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Side;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.CustomMenuItem;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jewelsea
jewelsea / Person.java
Last active August 28, 2022 22:11
JavaFX sample TableView with Add Buttons
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class Person {
private StringProperty firstName;
private StringProperty lastName;
public Person(String firstName, String lastName) {
setFirstName(firstName);
setLastName(lastName);
@leandrotoledo
leandrotoledo / gist:3019746
Created June 29, 2012 18:13
MDB to PostgreSQL with mdb-tools example
#!/bin/sh
mdb-schema Acadesc.mdb postgres | sed 's/Char/Varchar/g' | sed 's/Postgres_Unknown 0x0c/text/g' | psql -h localhost -U postgres -w -d acadesc > /dev/null 2>&1
tables=$(echo -en $(mdb-schema Acadesc.mdb postgres | grep "CREATE TABLE" | awk '{ print $3 }' | sed -e 's/"//g');)
for i in $tables
do
mdb-export -I postgres Acadesc.mdb $i | psql -h localhost -U postgres -w -d acadesc > /dev/null 2>&1
done
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git