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
import * as AWSXRay from "aws-xray-sdk"; | |
import { logger } from "./logger"; | |
export function trace(name: string) { | |
return (target: any, key: string, descriptor: PropertyDescriptor) => { | |
const originalMethod = descriptor.value; | |
descriptor.value = async function() { | |
let segment: AWSXRay.Subsegment | null = null; | |
try { | |
try { |
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
/* | |
* From Effective Java book - 2nd Edition - Author: Joshua Bloch | |
*/ | |
public final class PhoneNumber { | |
private final short areaCode; | |
private final short prefix; | |
private final short lineNumber; | |
public PhoneNumber(int areaCode, int prefix, | |
int lineNumber) { | |
rangeCheck(areaCode, 999, "area code"); |
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
#!/bin/bash | |
function jsonValue() { | |
KEY=$1 | |
num=$2 | |
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${num}p | |
} | |
KEY_TO_PARSE=$(curl -s -X GET "JSON_URL" | jsonValue KEY_TO_PARSE 1) | |
echo $KEY_TO_PARSE |
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
git log --oneline --pretty=format:"%h%x09%an%x09%ad%x09%s" |
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 Plugin extends PluginBase | |
{ | |
public function boot() | |
{ | |
parent::boot(); | |
$this->extendRainlabPost(); | |
} | |
protected function extendRainlabPost() { |
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
sudo update-alternatives --set php /usr/bin/php7.1 | |
sudo update-alternatives --set phar /usr/bin/phar7.1 | |
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1 | |
sudo update-alternatives --set phpize /usr/bin/phpize7.1 | |
sudo update-alternatives --set php-config /usr/bin/php-config7.1 |
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 | |
use Carbon\Carbon; | |
use Model; | |
use Validator; | |
/** | |
* Model | |
*/ | |
class WorkingSchedule extends Model | |
{ |
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
export DEPLOYMENT_FOLDER=/deployment-folder | |
export RELEASE_ROOT_FOLDER=$DEPLOYMENT_FOLDER/releases | |
export RELEASE_FOLDER=$DEPLOYMENT_FOLDER/releases/intermediate | |
cd $DEPLOYMENT_FOLDER/build | |
tar -xvf artifact.tar | |
rm -rf artifact.tar | |
cd $DEPLOYMENT_FOLDER | |
shopt -s dotglob | |
# Unzip and copy all files in artifact into the release folder | |
mkdir $RELEASE_FOLDER |
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
cd /usr/local/lib/node_modules/laravel-echo-server/ | |
npm install sqlite3 --save |
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
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable | |
sudo ln -sf /usr/local/n/versions/node/<version>/bin/node /usr/bin/node | |
sudo ln -sf /usr/local/n/versions/node/<version>/bin/npm /usr/local/bin/npm |
NewerOlder