...
"require": {
"vendor/package": "1.3.2", // exactly 1.3.2 (exact)
// >, <, >=, <= | specify upper / lower bounds
"vendor/package": ">=1.3.2", // anything above or equal to 1.3.2
"vendor/package": "<1.3.2", // anything below 1.3.2
// * | wildcard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias cow='ssh your-app "cd ~/your-app.com/current && php artisan horizon:status" | cowsay | lolcat' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias branches="git for-each-ref --count=15 --sort=-committerdate refs/heads/ --format='%(color:blue)%(committerdate:relative): %(color:green)%(refname:short)'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME=${PWD##*/} | |
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS \`$NAME\`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function isValid(\Illuminate\Http\Request $request){ | |
// Grab the Stripe-Signature header | |
$header_signature = $request->header('Stripe-Signature'); | |
// sets variables $t and $v1 with their values, (and any other elements that stripe may pass along that we'll ignore) | |
foreach(explode(',', $header_signature) as $key => $val){ | |
$prefix = str_before($val, '='); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function isValid(\Illuminate\Http\Request $request){ | |
// Grab the Stripe-Signature header | |
$header_signature = $request->header('Stripe-Signature'); | |
// sets variables $t and $v1 with their values, (and any other elements that stripe may pass along that we'll ignore) | |
foreach(explode(',', $header_signature) as $key => $val){ | |
$prefix = str_before($val, '='); | |
$$prefix = str_after($val, '='); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this to avoid syncing wp-uploads directory when working locally on a WordPress website | |
# Directives to send expires headers and turn off 404 error logging. | |
location ~* \.(js|css|png|jpe?g|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: wp-page-migrate | |
* Description: Edit the plugin to define your pages. Activate this plugin to add the pages to your WP install. | |
* Version: 0.0.1 | |
* Author: Alex P. Gates | |
* | |
* This is a simple plugin that, when activated, creates pages on a WordPress site if they don't already exist. | |
* This is useful for keeping local / staging / production in sync and for keeping pages in sync when working | |
* with lots of custom page templates with multiple people on the same project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// DayOne is a nice little journaling app for iOS / Mac (available via App Store). | |
// This code requires php_class_lib available here: https://github.com/jsjohnst/php_class_lib | |
include('php_class_lib/classes/parsers/plist/PlistParser.inc'); | |
// grab filenames for all of your journal entries | |
$entries = array(); | |
if ($handle = opendir('/path/to/your/Journal.dayone/entries')) { |