Skip to content

Instantly share code, notes, and snippets.

View LostinOrchid's full-sized avatar

Vigo2 LostinOrchid

  • Go2DesignLab
View GitHub Profile
@LostinOrchid
LostinOrchid / 0_reuse_code.js
Created April 5, 2017 00:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@LostinOrchid
LostinOrchid / 01install_lamp.md
Last active June 26, 2018 01:39
install LAMP stack in Amazon AMI
  1. Update packages
$ sudo yum update -y
  1. Install Apache, mysql and php.
$ sudo yum update http24 php70 mysql56-server php70-mysqlnd -y
  1. Start the Apache Web Server.
@LostinOrchid
LostinOrchid / post-receive.sh
Last active July 4, 2018 08:28
Example deployment script for roots bedrock
#!/bin/bash
# The document root of the project
APP_ROOT=
# The directory of the remote repository
GIT_DIR=
# What branch to accept
BRANCH="master"
composer=~/bin/composer
wp=~/bin/wp
@LostinOrchid
LostinOrchid / wp_db_create_backup.sh
Created July 6, 2018 04:25
Create database backup in Wordpress
#!/usr/bin/env bash
sqllocation=~/.sql_backup_files
# echo $(wp --version)
wp --version >/dev/null 2>&1 || {
echo "I need 'wp' command to be able to execute further"
exit 1
}
# Check if it is a wordpress directory or is installed
@LostinOrchid
LostinOrchid / wp_make_site_backup.sh
Created July 19, 2018 01:30
Make backup for a wordpress site
#!/usr/bin/env sh
project_root=$1
tmp_dir=$project_root/.tmp
files_dir=$tmp_dir/files
include_db=1
files=(
wp-config.php
wp-content/themes/zeko
wp-content/themes/zeko-child
@LostinOrchid
LostinOrchid / install_php71.sh
Last active August 3, 2018 00:31
Vagrant Debian/Ubuntu OS
#!/usr/bin/env sh
# Install php71
apt-get install -y python-software-properties
add-apt-repository -y ppa:ondrej/php
apt-get update -y
apt-get install -y php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-mbstring php7.1-gd php7.1-intl php7.1-xml php7.1-mysql php7.1-mcrypt php7.1-zip
# Tell apache to use php71
a2enmod proxy_fcgi setenvif
a2enconf php7.1-fpm
@LostinOrchid
LostinOrchid / object_assign_mutation.js
Last active September 20, 2018 02:56
Warning on object assign mutation
var a = {
one: {
nested: 'a',
onlyInA: 'a',
nestedMore: { what: 'a' },
},
aOnly: 'a only',
}, b = {
one: {
nested: 'b',
@LostinOrchid
LostinOrchid / encoding-video.md
Created April 8, 2019 05:51 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@LostinOrchid
LostinOrchid / update_wp_plugin
Last active June 1, 2020 06:34
Update Wordpress Plugin using Local zip file
#!/usr/bin/env bash
script_filename=$0
plugin_name=$1
version=$2
plugins_dir=~/plugins
old_plugins_dir=~/old-plugins
script_name="Wordress Plugin Updater"
script_description="Updates a wordpress plugin given the local plugin directory path."
plugin_filename=