This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install python-imaging | |
cd ~ | |
mkdir fontawesome | |
cd fontawesome/ | |
git clone git://github.com/odyniec/font-awesome-to-png.git | |
git clone https://github.com/FortAwesome/Font-Awesome | |
cd font-awesome-to-png/ | |
./font-awesome-to-png.py --font ../Font-Awesome/font/fontawesome-webfont.ttf --size 32 ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file Update script for image cache changes related to drupal 7.20 | |
* | |
* You will likely need to adjust the regexp and the $search and $replace | |
* variables in cleanup(). Note that image_style_path_token generates | |
* different tokens for different paths so you need to properly detect your | |
* site URLs and rewrite them in the most robust pattern for your site. | |
* | |
* The existing patterns work with patterns like the following; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File used for Drupal development. | |
# WARNING: This deletes your drupal DB and files directory. | |
# This resets the database and sets up settings.php and files dir. | |
# | |
# Usage: `./reset` | |
# base dir no trailing slash (change these next 5 lines; the lower code shouldn't need adjustment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "bytes" | |
import "html" | |
func main() { | |
s := Widget("myWidget", "checkbox", map[string] string{"checked": "checked", "someattr": "Value"}) | |
fmt.Println(s) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.articles.find().snapshot().forEach( function(x) { | |
x.Tags = x.Tags.split(','); | |
db.articles.save(x); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ContextFilter = func(c *Controller, fc []Filter) { | |
c.RenderArgs["mycontext"] = xyz | |
fc[0](c, fc[1:]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FAIL=1 # or some non zero error number you want | |
MAX_TRIES=4 | |
COUNT=0 | |
BACKOFF=1 | |
if [ $# -lt 1 ];then | |
echo "You must provide a command to execute. Commands with arguments must be quoted." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Currently runs "make deploy" just change that to whatever you want | |
(MAXTRIES=4; COUNT=0; BACKOFF=1; while [ $COUNT -lt $MAXTRIES ]; do (make deploy); if [ $? -eq 0 ];then exit 0; fi; let COUNT=COUNT+1; let BACKOFF=BACKOFF*2; echo "Attempt $COUNT failed retrying after $BACKOFF seconds"; sleep $BACKOFF; done; echo "Tried and failed $COUNT times. Giving up."; exit 1;) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NEWRAND=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1) | |
echo "Type the following; '$NEWRAND'" | |
read var1 | |
echo "You typed $var1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### Pretty-print dedicated (array) var, MAPFILE. | |
prettyPrintMAPFILE() { | |
let i=0 | |
echo "[MAPFILE]" | |
for l in "${MAPFILE[@]}" | |
do | |
echo "$i. |$l|" | |
let i++ | |
done |
OlderNewer