Skip to content

Instantly share code, notes, and snippets.

View MrAndrewMal's full-sized avatar
🏠
Working from home

André MrAndrewMal

🏠
Working from home
View GitHub Profile
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@umidjons
umidjons / sort-object-properties-by-value.md
Last active October 9, 2024 10:31
JavaScript: sort object properties by value (numeric or string)

Sort object properties by value (values are text)

I have following object:

var cities={10:'Tashkent', 14:'Karakalpakiya', 16:'Andijan'};

I want sort it by city names, so after sort it should be:

var cities={16:'Andijan', 14:'Karakalpakiya', 10:'Tashkent'};

But I can't sort object properties, instead can convert object into array, then sort items.

@tylerwalts
tylerwalts / update_library.pre.sh
Last active December 16, 2020 11:43
Bash script to add a ssh key to a user's home ssh config. Used prior to running a puppet librarian as part of a server bootstrap process.
#!/bin/sh
# Place the SSH key for the git service account used to access private repositories
home_path="$(cd && pwd)"
ssh_path="$home_path/.ssh"
mkdir -p $ssh_path
provider="bitbucket.org"
#provider="github.com"