gem install mailcatcher
mailcatcher
brew services restart php54
nginx -s reload
- Go to http://mail.dev/
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
# Recursive descent parser | |
# http://adayinthepit.com/2011/07/19/hanging-in-the-treetops/ | |
def exp(stack) | |
token = stack.shift | |
return stack if token =~ /[0-9]/ || token =~ /X/ && exp(stack) || token =~ /Y|Z/ && exp(stack) && exp(stack) | |
false | |
end | |
def parse(source) | |
stack = exp(source.split('')) |
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
function pathFromPolygon(points) { | |
var p = points.split(/\s+/); | |
var path = ''; | |
for( var i = 0, len = p.length; i < len; i++ ) { | |
path += (i && 'L' || 'M') + p[i] | |
} | |
return path; | |
} |
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
BlogPost::get() | |
->filter(['ParentID' => $this->owner->ParentID]) | |
->leftJoin('BlogPost_Categories', 'BlogPost.ID = BlogPost_Categories.BlogPostID') | |
->where( | |
'BlogCategoryID IN ( | |
SELECT BlogCategoryID FROM "BlogPost" | |
LEFT JOIN BlogPost_Categories ON BlogPost.ID = BlogPost_Categories.BlogPostID | |
WHERE BlogPost.ID = ' . $this->owner->ID . ')') | |
->exclude(['ID' => $this->owner->ID]) | |
->sort('RAND()') |
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
import Foundation; | |
struct Consumer { | |
var name: String | |
var handler: (Any) -> Void | |
} | |
class EventEmitter { | |
static var consumers: [Consumer] = []; |
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
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 180; | |
proxy_read_timeout 180; | |
proxy_buffer_size 128k; | |
proxy_buffers 4 256k; | |
proxy_busy_buffers_size 256k; | |
proxy_intercept_errors on; |
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
// Usage: | |
// .ReactCSSTransitionGroupMixin( | |
// {opacity: 0}, | |
// {opacity: 1}, | |
// {transition: opacity 300ms linear} | |
// ); | |
.ReactCSSTransitionGroupMixin(@disabled, @active, @transition) { | |
&-enter { | |
@disabled(); | |
&-active { |
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
cd $1 | |
if ! hash jq 2>/dev/null; then | |
brew install jq | |
fi | |
composer install | |
jq '.require."silverstripe/cms" = "~3.2.0"' composer.json > tmp.$$.json && mv tmp.$$.json composer.json | |
jq '.require."silverstripe/framework" = "~3.2.0"' composer.json > tmp.$$.json && mv tmp.$$.json composer.json |
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
server { | |
listen 8080; | |
root /Users/user/Sites/magento.co.nz; | |
server_name magento.dev "~magento\.(.*)\.xip\.io$"; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; | |
proxy_connect_timeout 90; | |
proxy_send_timeout 180; | |
proxy_read_timeout 180; |
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
.sprite-animation(@name, @frame-width, @frame-height, @url, @frame-count, @sprite-width, @duration) { | |
width: @frame-width; | |
height: @frame-height; | |
display: block; | |
background: url(@url) left center; | |
animation: @name @duration steps(@frame-count) infinite; | |
@keyframes @name { | |
100% { | |
background-position: @sprite-width; | |
} |
NewerOlder