Skip to content

Instantly share code, notes, and snippets.

View coreysan's full-sized avatar

Corey Sanford coreysan

  • Sanco Software
  • Vancouver, BC
View GitHub Profile
@coreysan
coreysan / gist:a263fb38d526ea814605
Last active August 29, 2015 14:20
Download files & a database from a remote server
#!/bin/bash
##############################
# Backup web server to tgz #
##############################
# ** Change values like this: [#specific-to-your-server#]
# This script SSH'es onto the server then :
# - dumps the mysql database
# - tars the db and the WordPress wp-content directory
@coreysan
coreysan / vdebug_homestead.md
Last active November 16, 2015 07:51
Debugging with vim in Homestead

#Debugging with vim in Homestead/Vagrant

This is a step-by-step on how to set up vim debugging in a vagrant (homestead) environment. This assumes that you have homestead set up.

The following tasks are performed on your Homestead box.

Install Pathogen

Pathogen allows simple installation of vim plugins. We'll need it to install vdebug. Get it here.

Install Vdebug

@coreysan
coreysan / PS1-coloring.sh
Last active December 28, 2016 01:19
PS1 coloring
[ -r /etc/bashrc ] && source /etc/bashrc
[ -r /etc/bash_completion ] && source /etc/bash_completion
[ -r ~/.git-completion.bash ] && source ~/.git-completion.bash
[ -r ~/.git-prompt.sh ] && source ~/.git-prompt.sh
[ -r /usr/local/rvm/scripts/rvm ] && source /usr/local/rvm/scripts/rvm
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;
@coreysan
coreysan / isContained.php
Created October 27, 2017 17:11
PHP Junior Test: isContained
<?php
/**
* Make the function pass all the tests!
*
* Your function should return true if and only if all tokens
* can be found in the long string given.
*
* Run this file on the command line using:
* $ php isContained.php
*
@coreysan
coreysan / person.php
Last active October 27, 2017 17:17
PHP Junior Test: Person Refactor
<?php
/**
* A poor programmer has written the following code!
*
* It runs, but it's full of bad practices,
* doesn't leverage inheritance, and abuses
* Object-Oriented-Programming principles.
*
* Refactor it like you're writing open-source
@coreysan
coreysan / .bashrc
Last active April 2, 2018 19:59
Bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
[ -r /etc/bashrc ] && source /etc/bashrc
[ -r /etc/bash_completion ] && source /etc/bash_completion
[ -r ~/.git-completion.bash ] && source ~/.git-completion.bash
# PS1 - next line required for PS1 clean/dirty
[ -r ~/.git-prompt.sh ] && source ~/.git-prompt.sh
[ -r /usr/local/rvm/scripts/rvm ] && source /usr/local/rvm/scripts/rvm
@coreysan
coreysan / sublime-preferences.json
Last active April 5, 2018 16:15
sublime preferences
{
"auto_complete_selector": "source, text",
"binary_file_patterns":
[
".phpintel/",
"*.dds",
"*.eot",
"*.gif",
"*.ico",
"*.jar",
@coreysan
coreysan / vscode-user-settings.json
Last active April 20, 2018 23:37
psi-header config
{
"editor.wordWrap": "on",
"editor.multiCursorModifier": "alt",
"fileheader.Author": "Corey Sanford",
"fileheader.LastModifiedBy": "Corey Sanford",
// Controls whether the prompt will show
"sublimeTextKeymap.promptV3Features": true,
// Changes the multi cursor mouse binding
"editor.multiCursorModifier": "ctrlCmd",

Keybase proof

I hereby claim:

  • I am coreysan on github.
  • I am coreysan (https://keybase.io/coreysan) on keybase.
  • I have a public key ASB52f_WQyHBnJ1XD5Fm207zPiGBwC45Q7IJdPG6WtBcnwo

To claim this, I am signing this object: