Skip to content

Instantly share code, notes, and snippets.

View ahmadtawakol's full-sized avatar

Ahmad Tawakol ahmadtawakol

  • Halifax, NS, Canada
View GitHub Profile
@ahmadtawakol
ahmadtawakol / remove-and-reinstall-cordova-plugins.sh
Created August 1, 2018 18:44
Remove and reinstall all cordova plugins
#This one-liner removes all cordova installed plugins and then adds them again.
#Note: If you are not using Ionic, change 'ionic cordova plugin' to 'cordova plugin'
#! /bin/bash
cordova plugin list | cut -d ' ' -f 1 | while read plugin; do ionic cordova plugin rm $plugin && ionic cordova plugin add $plugin; done
@ahmadtawakol
ahmadtawakol / anagramTest.sh
Last active August 29, 2015 14:17
Tests if two strings are an anagram. Run it with `./anagramTest.sh string1 string2`
#!/bin/bash
string1=$1
string2=$2
count=0
if [[ -e "$string2" || ( ${#string1} -ne ${#string2} ) ]]
then
echo "Not an anagram."
else
for (( i=0; i<${#string1}; i++ ))