Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
#!/bin/sh | |
# To run, download the script or copy the code to a '.sh' file (for example 'fluttercleanrecursive.sh') and run like any other script: | |
# sh ./fluttercleanrecursive.sh | |
# or | |
# sudo sh fluttercleanrecursive.sh | |
echo "Flutter Clean Recursive (by jeroen-meijer on GitHub Gist)" | |
echo "Looking for projects... (may take a while)" |
getLanguage: (language_code) -> | |
key = language_code.toLowerCase().replace(/-/, '_') | |
isoLangs = [ | |
{ code:"aa", name:"Afar" }, | |
{ code:"ab", name:"Abkhaz" }, | |
{ code:"ae", name:"Avestan" }, | |
{ code:"af", name:"Afrikaans" }, | |
{ code:"ak", name:"Akan" }, | |
{ code:"am", name:"Amharic" }, | |
{ code:"an", name:"Aragonese" }, |
This gist assumes:
www-data
(may be apache
on other systems)// source: http://stackoverflow.com/questions/16491758/remove-objects-from-array-by-object-property | |
// we have an array of objects, we want to remove one object using only the id property | |
var apps = [{id:34,name:'My App',another:'thing'},{id:37,name:'My New App',another:'things'}]; | |
// get index of object with id:37 | |
var removeIndex = apps.map(function(item) { return item.id; }).indexOf(37); | |
// remove object | |
apps.splice(removeIndex, 1); |