Skip to content

Instantly share code, notes, and snippets.

View creativecoder's full-sized avatar

Grant Kinney creativecoder

  • Madison, Wisconsin, USA
View GitHub Profile
#!/bin/sh
# any2markdown.sh
#
# A shell script that converts documents to markdown
#
# https://gist.github.com/creativecoder/4990796
#
# Depends on:
# pandoc: http://johnmacfarlane.net/pandoc/
@creativecoder
creativecoder / gist:5475025
Created April 27, 2013 22:36
Redirect user to plugin settings page upon plugin activation, if only this plugin is being activated
// Redirect if not activating multiple plugins at once
if( ! isset( $_GET['activate-multi'] ) ) {
wp_redirect( admin_url( 'options-general.php?page=my-plugin-options' ) );
}
@creativecoder
creativecoder / Unix Command Line Notes.md
Created July 3, 2013 01:58
Unix Command Line Notes

Unix Command Line Notes

  • Command settings
    • .bashrc
      • Aliases - place the following on a new line in the .bashrc file
        • alias [alias-name]='[alias command(s)]
        • Ex:alias ls='ls -lh'
    • .profile or .bash_profile
  • Add folders to you path
@creativecoder
creativecoder / httpd-vhosts.conf
Last active March 8, 2017 23:55
Apache redirect for missing images
# Place inside a <VirtualHost> or <Directory> declaration
#
# Particularly useful for displaying images in a local development environment
# without actually downloading all of the images
#
# Props to Mark Jaquith for the suggestion at WordCamp SF 2013
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*)(png|jpg|jpeg|gif|svg)$ http://www.example.com$1$2 [L]
@creativecoder
creativecoder / .gitignore
Created August 8, 2013 02:54
.gitignore all but the specified subdirectory
# Ignore all files except for a particular directory
*
# Don't ignore directories themselves, else we can't add anything to the repository
!*/
# Don't ignore any directory with the name "path"
!**/path/*
# or its subdirectories
!**/path/**/*
# And don't forget .gitignore itself

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.

@creativecoder
creativecoder / Git Notes.md
Created April 17, 2014 23:25
git version control notes

Git Version Control

  • Understanding git
    • Anatomy of git
      • HEAD
        • Think of it as the snapshot of your last commit
        • Pointer to the current branch reference, which is the last commit you made or the last commit that was checked out
      • Index
  • Snapshot of your next commit
@creativecoder
creativecoder / LaravelContext.php
Last active August 29, 2015 14:26
Laravel FeatureContext for testing with Behat (use this to extend your FeatureContext class instead of Mink)
<?php
use Illuminate\Foundation\Testing\ApplicationTrait;
use Illuminate\Foundation\Testing\AssertionsTrait;
use Illuminate\Foundation\Testing\CrawlerTrait;
class LaravelContext extends PHPUnit_Framework_TestCase
{
use ApplicationTrait, AssertionsTrait, CrawlerTrait;
@creativecoder
creativecoder / pagination.js
Last active September 19, 2015 00:42
vue.js pagination component
var _ = require('lodash');
/*
Example:
<pagination
current-page='@{{@ currentPage}}'
total-items='@{{totalItems}}'
per-page='@{{perPage}}'>
</pagination>
*/
module.exports = {

SSH Notes

These notes apply to OpenSSH

  • SSH sessions
    • Initiate a session
      • Use ssh [email protected] to initiate an ssh session (can alternatively use ssh -l user domain.com)
    • Files stored locally in ~/.ssh
      • Known hosts
  • The first time you connect to a remote server via SSH, you are asked if you want to continue--if you do, that server is added to the known_hosts file