Skip to content

Instantly share code, notes, and snippets.

View hotmeteor's full-sized avatar
👾

Adam Campbell hotmeteor

👾
View GitHub Profile
@hotmeteor
hotmeteor / EventServiceProvider.php
Last active February 17, 2018 23:34
Handling delayed notifications in Laravel, pt. 3
<?php
namespace App\Base\Providers;
use App\Notifications\Listeners\NotificationSendingListener;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Notifications\Events\NotificationSending;
class EventServiceProvider extends ServiceProvider
{
@hotmeteor
hotmeteor / php-openssl.md
Last active December 10, 2017 07:21 — forked from ryanscherler/php-openssl.md
Use Homebrew PHP with OpenSSL instead of SecureTransport
@hotmeteor
hotmeteor / php-cs-fixer
Last active May 25, 2016 14:58 — forked from mpalourdio/php-cs-fixer
@fabpot php-cs-fixer config for PhpStorm
parameters
--level=psr2 --fixers=strict,strict_param,ordered_use,multiline_spaces_before_semicolon,short_array_syntax,concat_without_spaces,double_arrow_multiline_whitespaces,duplicate_semicolon,empty_return,extra_empty_lines,include,multiline_array_trailing_comma,namespace_no_leading_whitespace,new_with_braces,object_operator,operators_spaces,phpdoc_params,remove_leading_slash_use,remove_lines_between_uses,return,single_array_no_trailing_comma,spaces_before_semicolon,spaces_cast,standardize_not_equal,ternary_spaces,unused_use,whitespacy_lines,-psr0 --verbose --config=sf23 fix "$FileDir$/$FileName$"
working directory
$ProjectFileDir$
@hotmeteor
hotmeteor / insert_at_index.php
Last active May 23, 2016 20:19
Insert record into a collection at a specific index
<?php
$collection = collect([ 'red', 'blue' ]);
$collection->splice(1, 0, ['yellow']);
$collection->all();
// ['red', 'yellow', 'blue'];
@hotmeteor
hotmeteor / facebook
Last active December 5, 2022 20:30
Social media meta tag templates
<!-- Social: Facebook / Open Graph -->
<meta property="fb:admins" content="503386332">
<meta property="fb:app_id" content="1389892087910588">
<meta property="og:url" content="http://scotch.io/bar-talk/bootstrap-3-tips-and-tricks-you-might-not-know">
<meta property="og:type" content="article">
<meta property="og:title" content="Bootstrap 3 Tips and Tricks You Might Not Know">
<meta property="og:image" content="/wp-content/uploads/2014/05/bs31.jpg"/>
<meta property="og:description" content="Bootstrap 3 has a ton of features and helpers to speed up front-end development. Sometimes you need something and you end up writing your own custom CSS and JavaScript without even realizing that Bootstrap could have done it for you....">
<meta property="og:site_name" content="Scotch">
<meta property="article:author" content="https://www.facebook.com/NCerminara">
@hotmeteor
hotmeteor / generate_timezone_list.php
Last active October 27, 2024 04:28
[PHP] Generate a timezone list with optgroups
/**
* Inspired by http://stackoverflow.com/questions/1727077/generating-a-drop-down-list-of-timezones-with-php
* @return array
*/
function generate_timezone_list()
{
static $regions = [
'Africa' => DateTimeZone::AFRICA,
'Americas' => DateTimeZone::AMERICA,
@hotmeteor
hotmeteor / timeline.json
Last active August 29, 2015 14:11
Example timeline data
{
"count": 12,
"settings": {
"email": true,
"sms": false
},
"data" : [{
"d" : {
"_id" : "5463b6b33c58b14f27eeacd4",
"sysid" : "140060969",
@hotmeteor
hotmeteor / accountImage
Created November 14, 2014 14:06
Extract OS X user profile image
dscl . -read /Users/[YourUsername] JPEGPhoto | tail -1 | xxd -r -p > ~/Desktop/accountImage.jpg
Verifying that +hotmeteor is my openname (Bitcoin username). https://onename.io/hotmeteor
@hotmeteor
hotmeteor / mamp-brew-imagemagick
Last active August 29, 2015 14:08
MAMP and brew Imagemagick path
Source: http://omeka.org/forums/topic/ye-olde-imagemagickmamp-path-problem
1. Navigate to: /Applications/MAMP/Library/bin/envvars
2. Open `envvars` and comment out these two lines:
```#DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
#export DYLD_LIBRARY_PATH```
3. Add `export PATH="$PATH:/usr/local/bin"`
4. Restart MAMP
5. Profit $$$