Skip to content

Instantly share code, notes, and snippets.

View shoemoney's full-sized avatar

Jeremy Schoemaker shoemoney

View GitHub Profile
@shoemoney
shoemoney / .vimrc
Created October 12, 2019 00:07 — forked from chibicode/.vimrc
Goodbye Vim, Hello Sublime Text, and My Final .vimrc
" vim:fdm=marker
" Vundle {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'airblade/vim-gitgutter'
Bundle 'bling/vim-airline'
Bundle 'chriskempson/base16-vim'
@shoemoney
shoemoney / valet.conf
Created March 30, 2020 18:49 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@shoemoney
shoemoney / README.md
Created May 22, 2020 09:26 — forked from aronwoost/README.md
Build auto-deploy with php and git(hub) on an EC2 Amazon AMI instance

Kind of continue from the other gist how to install LAMP on an Amazon AMI

##Install git

sudo yum install git-core

##Create ssh directory since it doesn't exists by default on the Amazon AMI

@shoemoney
shoemoney / node-and-npm-in-30-seconds.sh
Created June 23, 2020 07:40 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@shoemoney
shoemoney / commands.js
Created September 3, 2020 16:35 — forked from hassansin/commands.js
MongoDB commands
db.collection.createIndex( { orderDate: 1, zipcode: -1 }, {background: true} )
db.events.ensureIndex( { "timestampISO": 1 }, { expireAfterSeconds: 120*24*60*60 } ) // <3.0, TTL index, 120day retention period
db.collection.getIndexes() //get all indexes
db.collection.dropIndex("name"); //drop single index
db.collection.dropIndexes(); //drop all indexes
db.collection.find({ email: 'test@sendgrid.com' }).explain("executionStats") // <3.0 : https://docs.mongodb.org/manual/reference/method/cursor.explain/#cursor.explain
//https://docs.mongodb.org/manual/tutorial/measure-index-use/
db.collection.explain("executionStats").find({ email: 'test@sendgrid.com' }) // 3.0 +
db.events.totalIndexSize() // in bytes, should not exceed RAM
<?php
namespace App\Charts;
use App\Support\Livewire\ChartComponentData;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
/**
* Class WanSpeedTestsChart
*
@shoemoney
shoemoney / Sortable.php
Created September 30, 2020 18:10 — forked from iksaku/Sortable.php
A helper trait that provides basic PHP compatibility with @livewire's Sortable package
<?php
trait Sortable
{
/**
* This function receives a $newOrder array parameter, which contains the order in which
* we should sort our items after being dragged in the UI. The format of the $newOrder is:
*
* [
* newIndex => [
@shoemoney
shoemoney / 1-plexbox-setup-README.md
Created October 3, 2020 19:11 — forked from mturley/1-plexbox-setup-README.md
Ubuntu Server plexbox setup

Start with a fresh Ubuntu Server 16.04 installation. NOTE: In the commands and files below, be sure to replace <yourusername> with your username and <yourgroupname> with your group name (probably the same as your username). Also, replace <yourhostname> with your server's hostname.

Install Dependencies:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-official.list
sudo apt update
@shoemoney
shoemoney / arrow-functions-and-equality.js
Created October 3, 2020 19:12 — forked from mturley/arrow-functions-and-equality.js
More ranting about JavaScript for Jenn
/*
Jenn, I was looking back on the github examples I gave you and realized one more thing:
If you didn't know it already, the ES6 arrow function syntax, has two shorthands
the first one I showed in my example already:
*/
const arrowFn = () => { };
const arrowFn = () => { return thing; };
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;