Skip to content

Instantly share code, notes, and snippets.

View gianick's full-sized avatar

Nikolas gianick

  • Newcastle upon Tyne, UK
View GitHub Profile
@gianick
gianick / postal-codes.json
Created May 13, 2020 11:40 — forked from jamesbar2/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@gianick
gianick / gist:66d23a740911a5cace3256248b30ce4f
Created November 18, 2017 10:48 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@gianick
gianick / find-oversized-element.js
Created August 25, 2017 12:19 — forked from headquarters/find-oversized-element.js
Find the offending element causing a horizontal scrollbar at any screen width (requires jQuery).
var screenWidth = window.innerWidth;
var visibleElements = jQuery(":visible");
visibleElements.each(function(){
var $this = jQuery(this);
if($this.width() > screenWidth){
$this.css("border", "1px solid green");
console.log("Screen width is " + screenWidth + " and the following element is " + $this.width(), $this);
}
});
@gianick
gianick / git-command-prompt.sh
Last active September 6, 2017 11:18 — forked from badrobit/blah.sh
Git repository status in your ubuntu terminal
# Note: This should be placed in your .bashrc or .bash or .profile or whatever it is you use to control your
# terminals appearance.
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green