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
## WARNING: THIS IS CURRENTLY NOT WORKING BECAUSE SELENIUM DOES NOT HAVE | |
## A DISPLAY IN WHICH TO LAUNCH | |
description "Selenium Server Standalone" | |
author "Yusuf" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
#Respawn the process if it crashes |
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
description "Turn `project name` bot into a daemon" | |
author "Yusuf Hasan Miyan" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
script | |
echo $$ > /var/run/project-name-bot.pid | |
chdir /path/to/project-name-bot | |
exec sudo -u $user /usr/bin/npm start |
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
<!-- taken from http://stackoverflow.com/a/12121309/351590 --> | |
<div class="wrapper"> | |
<div class="main"> | |
This is your div with the specified aspect ratio. | |
</div> | |
</div> | |
<style> | |
.wrapper { | |
width: 50%; | |
/* whatever width you want */ |
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
mysql -uroot -ppassw0rd --execute "CREATE DATABASE <db_name>;" |
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 | |
host=$1 | |
# first remove the host's key if it exists | |
ssh-keygen -R $host | |
# then add to the known_hosts file | |
ssh-keyscan -H $host >> ~/.ssh/known_hosts |
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 | |
$remote_name=$1 | |
$remote_url=$2 | |
git ls-remote --exit-code $remote_name &>/dev/null | |
if [ $? -ne 0 ]; then | |
git remote add $remote_name $remote_url | |
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/sh | |
# Copied from http://whaaat.com/rename-drupal-module-cli | |
old=$1 | |
new=$2 | |
mv $old $new | |
cd $new | |
rename "s/$old/$new/g;" * | |
perl -pi -w -e "s/$old/$new/g;" * |
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 | |
sed -i 's/archive.ubuntu.com/au.archive.ubuntu.com/g' /etc/apt/sources.list |
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
.parent-element { | |
-webkit-transform-style: preserve-3d; | |
-moz-transform-style: preserve-3d; | |
transform-style: preserve-3d; | |
} | |
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); |
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
# Create a bookmark using the following command | |
hash -d -- bookmark_name=/path/to/dir | |
# Access using | |
cd ~bookmark_name |