Skip to content

Instantly share code, notes, and snippets.

View sl-digital's full-sized avatar

SL Digital sl-digital

View GitHub Profile
@sl-digital
sl-digital / radius.php
Created June 14, 2017 21:50
ElasticSearch Radius Search with Distance Sort
$lat = $this->listing->latitude;
$lon = $this->listing->longitude;
$params = [
"index" => "listings",
"body" => [
"from" => 0,
"size" => 26,
"query" => [
"bool" => [
@sl-digital
sl-digital / query_string.php
Created June 14, 2017 21:44
ElasticSearch Query String Search
$default = [
"query_string" => [
"default_operator" => "AND",
"fields" => ["name","desc","tags","city"],
"query" => $query
]
];
$filtered = [
"bool" => [
@sl-digital
sl-digital / webpack.package.json
Created May 1, 2017 17:03
Webpack Package File for Laravel/Vue
{
"name": "vue-webpack",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
@sl-digital
sl-digital / webpack.config.js
Last active August 4, 2021 01:33
Webpack Config File for Laravel/Vue
//=================================================================================
// WEBPACK MODULES
//=================================================================================
const ora = require('ora');
const path = require('path');
const webpack = require('webpack');
//=================================================================================
// WEBPACK OUTPUT PATHS
@sl-digital
sl-digital / webpack.init.js
Last active May 1, 2017 17:05
Webpack Init File for Laravel/Vue
//=================================================================================
// WEBPACK MODULES
//=================================================================================
const ora = require('ora');
const path = require('path');
const chalk = require('chalk');
const rimraf = require('rimraf')
const webpack = require('webpack');
const config = require('./webpack.config');
@sl-digital
sl-digital / gist:854fb67f3d1bd3359a1349c8e7f9674d
Last active July 20, 2017 17:14
Vagrant: CentOS 7 MariaDB Remote Access
# VAGRANT FILE
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 3306, host: 33060
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder "./webroot", "/var/www/html", create:true, owner:"apache", group:"apache"
# MYSQL BIND
Change 127.0.0.1 to 0.0.0.0
# MYSQL/MARIADB COMMAND - ONLY DO THIS FOR LOCAL DEVELOPMENT!!!
@sl-digital
sl-digital / CentOS_7_LAMP_Install.txt
Last active April 14, 2017 18:19
CentOS 7 LAMP Install
# SWITCH TO ROOT
sudo su
# CREATE A NEW USER
adduser devops
passwd whatevs
# GRANT SUDO
gpasswd -a devops wheel
@sl-digital
sl-digital / Ubuntu_16.04_LEMP_Install.txt
Last active July 6, 2017 15:22
Ubuntu 16.04 LEMP Install
# CREATE USERS
sudo su <enter root password>
adduser devops
usermod -aG sudo devops
# SSH KEYGEN (LOCAL)
ssh-keygen <follow prompts and save>
cat ~/.ssh/yourkey_rsa.pub <copy contents>
# SSH KEYGEN (SERVER)
@sl-digital
sl-digital / Ubuntu_16.04_LAMP_Install.txt
Created April 14, 2017 16:01
Ubuntu 16.04 LAMP Install
# CREATE USERS
sudo su <enter root password>
adduser devops
usermod -aG sudo devops
# SSH KEYGEN (LOCAL)
ssh-keygen <follow prompts and save>
cat ~/.ssh/yourkey_rsa.pub <copy contents>
# SSH KEYGEN (SERVER)
@sl-digital
sl-digital / Permissions.txt
Created September 26, 2016 16:07
Webroot File Permissions
# Let Apache be initial owner
chown -R www-data:www-data /var/www/html
# Create an admin user
adduser admin
usermod -a -G sudo admin
usermod -a -G www-data admin
# Create a deployment user
adduser deployer