Skip to content

Instantly share code, notes, and snippets.

function cus_func(input, search) {
var list = search.split(/[\[\]\.]/);
var new_key;
for (var key in list) {
new_key = list[key].replace(/^['"](.*?)['"]$/gm, '$1');
input = ImageHelper.get(input, new_key);
}
{
"rules": {
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": false,
"eofline": true,
<code_scheme name="Main">
<option name="AUTODETECT_INDENTS" value="false" />
<JSCodeStyleSettings>
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings>
<option name="SPACE_BEFORE_TYPE_COLON" value="true" />
<option name="ALIGN_VAR_STATEMENTS" value="2" />
<option name="REFORMAT_C_STYLE_COMMENTS" value="true" />
@kevupton
kevupton / Laravel PHP7 LEMP AWS.md
Last active October 14, 2017 14:39 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@kevupton
kevupton / index.d.ts
Created December 26, 2017 01:56
store2 fix
declare namespace store {
const local : StoreAPI;
const session : StoreAPI;
function area (id : string, area : Storage) : StoreAPI;
function set (key : any, data : any, overwrite? : boolean) : any;
function setAll (data : Object, overwrite? : boolean) : StoredData;
function get (key : any, alt? : any) : any;
function getAll () : StoredData;
function transact (key : any, fn : (data : any) => any, alt? : any) : StoreAPI;
<code_scheme name="Main" version="173">
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="ALIGN_ASSIGNMENTS" value="true" />
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
<option name="PHPDOC_WRAP_LONG_LINES" value="true" />
<option name="ELSE_IF_STYLE" value="COMBINE" />
@kevupton
kevupton / test.json
Created January 9, 2019 07:45
Test File
{
"Test": true
}
@kevupton
kevupton / xxx.sh
Last active February 18, 2019 22:13
Git Commiter with ID
#!/bin/bash
{
# BRANCH="feature/AGS-62-agtrader-digital-ad-changes-for-d"
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>&1)
} || {
echo "Is not a git repository..."
exit 1;
}
@kevupton
kevupton / xc.sh
Last active February 18, 2019 22:15
Checkouter
#!/bin/bash
command=$(basename $0)
usage() { printf "Usage: ${BLUE}$command${NC} ${RED}[search-term]${NC} ${GREEN}[-f]${NC}\n" 1>&2; exit 1; }
CODE=$1
TMP=~/.xc
TIME_CHANGE=3600
RED='\033[0;33m'
@kevupton
kevupton / convert-webp
Created April 5, 2019 04:44
WebP convert all images in current directory
#!/bin/bash
for file in *
do
echo "Converting: '$file'"
cwebp -q 80 "$file" -o "webp/$file.webp" > /dev/null 2>&1
done
echo "Complete!"