Skip to content

Instantly share code, notes, and snippets.

View hotmeteor's full-sized avatar
👾

Adam Campbell hotmeteor

👾
View GitHub Profile
@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 February 12, 2023 23:03
[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 $$$
@hotmeteor
hotmeteor / .sublime-keymap
Last active September 7, 2018 12:16
Sublime backtick auto-pair
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.backtick", "match_all": true }
]
},
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`${0:$SELECTION}`"}, "context":