Skip to content

Instantly share code, notes, and snippets.

@gr0g
gr0g / init.vim
Created April 27, 2021 14:26 — forked from benawad/init.vim
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@gr0g
gr0g / Nginx_Cheat_Sheet.md
Created February 5, 2021 12:30 — forked from carlessanagustin/Nginx_Cheat_Sheet.md
Nginx Cheat Sheet
@gr0g
gr0g / simpleXmlToArray.php
Created May 13, 2019 05:31 — forked from jasondmoss/simpleXmlToArray.php
Convert a SimpleXML object to associative array
<?php
/**
* Convert a SimpleXML object to an associative array
*
* @param object $xmlObject
*
* @return array
* @access public
*/
@gr0g
gr0g / nginx_cakephp.dev.conf
Created November 11, 2018 18:47 — forked from Linnk/nginx_cakephp.dev.conf
NGINX configuration file for CakePHP projects with subdirectory
# NGINX Configuration for CakePHP projects with url subdirectories.
#
# In a classic-default-generic CakePHP project you can have as many
# independent applications as you want just by copying the app/
# directory. Apache and the .htaccess files will make the magic, but
# in a nginx server you will need a touch to your virtualhost conf.
#
# So, in order to make this:
#
# example.com/ —> ~/cakephp.dev/app/webroot/index.php
@gr0g
gr0g / CitiesArray.php
Created June 13, 2018 14:32 — forked from jonathonbyrdziak/CitiesArray.php
Cities Array :: An array of USA cities, as of April 2010
array(
'ALABAMA'=>
array('ABBEVILLE','ADAMSVILLE','ADDISON','AKRON','ALABASTER','ALBERTVILLE','ALEXANDER CITY','ALEXANDRIA','ALICEVILLE','ALLGOOD','ALTOONA','ANDALUSIA','ANDERSON','ANNISTON','ARAB','ARDMORE','ARGO','ARITON','ARLEY','ASHFORD','ASHLAND','ASHVILLE','ATHENS','ATMORE','ATTALLA','AUBURN','AUTAUGAVILLE','AVON','BABBIE','BAILEYTON','BANKS','BAY MINETTE','BAYOU LA BATRE','BEAR CREEK','BEATRICE','BEAVERTON','BELK','BENTON','BERRY','BESSEMER','BILLINGSLEY','BIRMINGHAM','BLACK','BLOUNTSVILLE','BLUE MOUNTAIN','BLUE RIDGE','BLUE SPRINGS','BOAZ','BOLIGEE','BON AIR','BRANCHVILLE','BRANTLEY','BRENT','BREWTON','BRIDGEPORT','BRIGHTON','BRILLIANT','BROOKSIDE','BROOKWOOD','BRUNDIDGE','BUTLER','BYNUM','CAHABA HEIGHTS','CALERA','CAMDEN','CAMP HILL','CARBON HILL','CARDIFF','CAROLINA','CARROLLTON','CASTLEBERRY','CEDAR BLUFF','CENTER POINT','CENTRE','CENTREVILLE','CHALKVILLE','CHATOM','CHELSEA','CHEROKEE','CHICKASAW','CHILDERSBURG','CITRONELLE','CLANTON','CLAY','CLAYHATCHEE','CLAYTON','CLEVELAND','CLIO','COALING',
@gr0g
gr0g / contains-case-insensitive.js
Created February 11, 2018 22:05 — forked from jakebresnehan/contains-case-insensitive.js
Make jQuery :contains Case-Insensitive
//Code for overloading the :contains selector to be case insensitive:
//Without the overload on the :contains selector jquery would normaly only underline the second line
// New selector
jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
// Overwrites old selecor
@gr0g
gr0g / README.md
Created February 4, 2018 04:07 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@gr0g
gr0g / route53-user-policy.json
Created January 8, 2018 02:08 — forked from dfox/route53-user-policy.json
An IAM policy for Amazon AWS to allow limited access to Route 53
{
"Statement":[
{
"Action":[
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect":"Allow",
"Resource":[
@gr0g
gr0g / wp-auto-login-single-user.php
Created May 12, 2017 14:36 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page. Redirect to home page once logged in. Prevent viewing the login page. Tested with WP 3.9.1. Used in functions.php
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page
@gr0g
gr0g / Ajax Setup
Created February 27, 2017 13:51 — forked from gladiatorAsh/Ajax Setup
Ajax Setup
$.ajaxSetup({
cache: false,
tryCount: 0,
retryLimit: 3,
error: function (xhr, textStatus, errorThrown) {
$.unblockUI();
Spin.stopSpin();
// lang = "HI";
if (xhr.status == 404) {
console.log("Service not found");