Skip to content

Instantly share code, notes, and snippets.

View javiergarval's full-sized avatar

Javier García Valdepeñas javiergarval

View GitHub Profile
@growtopiajaw
growtopiajaw / update-python.md
Created August 11, 2018 05:09
update-alternatives for python2 and python3 in Ubuntu 16.04.x

List available python options

ls -larth `which python`*
lrwxrwxrwx 1 root root   10 Mar 23  2016 /usr/bin/python3m -> python3.5m
lrwxrwxrwx 1 root root    9 Mar 23  2016 /usr/bin/python3 -> python3.5
lrwxrwxrwx 1 root root    9 Nov 24  2017 /usr/bin/python2 -> python2.7
lrwxrwxrwx 1 root root    9 Nov 24  2017 /usr/bin/python -> python2.7
-rwxr-xr-x 2 root root 4.3M Nov 28  2017 /usr/bin/python3.5m
-rwxr-xr-x 2 root root 4.3M Nov 28  2017 /usr/bin/python3.5
@squarism
squarism / iterm2.md
Last active May 4, 2024 13:06
An 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)
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@basham
basham / css-units-best-practices.md
Last active April 29, 2024 10:40
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@alexpchin
alexpchin / Add_Existing_Project_To_Git.md
Created June 1, 2014 20:14
Add Existing Project To Git Repo

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
@Arkham
Arkham / remote.md
Last active November 25, 2023 09:34
Remote, office not required

Remote, Office Not Required

The Time is Right for Remote Work

Why work doesn't happen at work

The office during the day has become the last place people want to be when then really want to get work done.

Offices have become interruption factories: it's just one interruption after

@arnobroekhof
arnobroekhof / pre-commit
Last active May 9, 2022 13:41
Maven pre commit hook
#!/bin/bash
# save the file as <git_directory>/.git/hooks/pre-commit
echo "Running Maven clean test for errors"
# retrieving current working directory
CWD=`pwd`
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# go to main project dir
cd $MAIN_DIR/../../
@sloria
sloria / bobp-python.md
Last active May 1, 2024 08:37
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet