This file contains hidden or 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
BAK="/bkp" | |
GZIP="$(which gzip)" | |
NOW=$(date +"%d-%m-%y_%T_%Z") | |
[ ! -d "$BAK" ] && mkdir -p "$BAK" | |
FILE=$BAK/backup$NOW.tar | |
FOLDERTOBACKUP=/var/www/ | |
echo "Tarring the folder $FOLDERTOBACKUP to $FILE Please wait ..." |
This file contains hidden or 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
function parseExpression(program) { | |
program = skipSpace(program); | |
var match, expr; | |
if (match = /^"([^"]*)"/.exec(program)) { | |
expr = {type: "value", value: match[1]}; | |
} else if (match = /^\d+\b/.exec(program)) { | |
expr = {type: "value", value: Number(match[0])}; | |
} else if (match = /^[^\s(),"]+/.exec(program)) { | |
expr = {type: "word", name: match[0]}; |
This file contains hidden or 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
class BSTnode(object): | |
""" | |
Representation of a node in a binary search tree. | |
Has a left child, right child, and key value, and stores its subtree size. | |
""" | |
def __init__(self, parent, t): | |
"""Create a new leaf with key t.""" | |
self.key = t | |
self.parent = parent | |
self.left = None |
#simple- cd to directory with the git initialized and pull origin develop or master echo "Running deployment" cd /var/www/html git pull origin develop echo "Repo updated with develop"`
This file contains hidden or 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
function getJarPercentages(){ | |
var totalBudget = process.argv[2]; | |
console.log("55% of totalBudget is " + totalBudget * 0.55); | |
console.log("5% of totalBudget is " + totalBudget * 0.05 + " (GIV)"); | |
console.log("10% of totalBudget is " + totalBudget * 0.10); | |
} | |
if(process.argv[2]) { | |
getJarPercentages(); |
-
Once your instance is ready to use, connect via SSH to the server using the public DNS and the public key:
ssh -i key.pem [email protected]
-
Update your AMI instance!
sudo yum update -y
-
Install docker!
sudo yum install docker -y
This file contains hidden or 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 | |
class Node { | |
public $info; | |
public $left; | |
public $right; | |
public $level; | |
public function __construct($info) { | |
$this->info = $info; | |
$this->left = NULL; | |
$this->right = NULL; |
Source: https://coderwall.com/p/euwpig/a-better-git-log
It's simple. Just type in:
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal: