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
# Navigation | |
alias ..='cd ..' | |
alias ...='cd ../../' | |
alias ....='cd ../../../' | |
alias clr='clear' | |
alias f='find . -type f -name' | |
alias size='du -sh ./* | sort -h' | |
alias work='cd $(git rev-parse --show-toplevel 2>/dev/null || echo "$HOME"/work)' | |
# Zsh specific |
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
// Navigate to reports -> Billings and Earnings -> Lifetime Billed | |
if (window.location.href === "https://www.upwork.com/nx/payments/reports/earnings") { | |
var data = document.querySelectorAll("[data-qa='total']"); | |
var amount = []; | |
const sumOfEarnings = arr => arr.reduce((a, b) => a + b, 0); | |
if (data) { | |
data.forEach(data => { | |
let value = parseFloat(data.innerText.substring(1).replace(/,/g, '')); | |
!isNaN(value) ? amount.push(value) : false; |
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
// Forked from LocalStorage Helper by https://gist.github.com/AndreVarandas/81098170cd71349e7a32 | |
const store = (function () { | |
var ls = {}; | |
ls.hasData = function (key) { // check if the data is available | |
return !!localStorage[key] && !!localStorage[key].length; | |
} | |
ls.get = function (key) { // get an stored item from localStorage | |
if (!this.hasData(key)) { | |
return false; | |
} |
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 | |
function backup_mysql_database($options){ | |
$mtables = array(); $contents = "-- Database: `".$options['db_to_backup']."` --\n"; | |
$mysqli = new mysqli($options['db_host'], $options['db_uname'], $options['db_password'], $options['db_to_backup']); | |
if ($mysqli->connect_error) { | |
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error); | |
} | |
$results = $mysqli->query("SHOW TABLES"); |
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
// CSS Color Names | |
// Compiled by @bobspace. | |
// | |
// A javascript array containing all of the color names listed in the CSS Spec. | |
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp | |
// Use it as you please, 'cuz you can't, like, own a color, man. | |
var CSS_COLOR_NAMES = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory" |
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
var colors = { | |
ALICEBLUE: '#F0F8FF', | |
ANTIQUEWHITE: '#FAEBD7', | |
AQUA: '#00FFFF', | |
AQUAMARINE: '#7FFFD4', | |
AZURE: '#F0FFFF', | |
BEIGE: '#F5F5DC', | |
BISQUE: '#FFE4C4', | |
BLACK: '#000000', | |
BLANCHEDALMOND: '#FFEBCD', |