Skip to content

Instantly share code, notes, and snippets.

@kevupton
kevupton / user-data.sh
Last active April 11, 2022 19:02
User Data for initializing an EC2 using Ubuntu with Docker GPU
#!/bin/bash
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update -qq
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@kevupton
kevupton / aws_puppeteer_fix.sh
Created March 21, 2018 11:01
Fix for AWS puppeteer linux instance
#!/bin/bash
# Fixes the puppeteer not being able to spawn an instance on their AWS linux instance.
# Install ATK from CentOS 7
sudo yum install cups-libs dbus-glib libXrandr libXcursor libXinerama cairo cairo-gobject pango
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/atk-2.22.0-3.el7.x86_64.rpm
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-atk-2.22.0-2.el7.x86_64.rpm
sudo rpm -ivh --nodeps http://mirror.centos.org/centos/7/os/x86_64/Packages/at-spi2-core-2.22.0-1.el7.x86_64.rpm
<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 / 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;
{
"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
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);
}