-
Install Homebrew:
- Follow the install instructions found on this page.
-
Tap the wonderful homebrew-php from https://github.com/Homebrew/homebrew-php
$ brew tap homebrew-php
This file contains hidden or 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 vec3(xx, yy, zz) { | |
| this.x = xx || 0; | |
| this.y = yy || 0; | |
| this.z = zz || 0; | |
| this.translate = function (d) { return new vec3(this.x+d[0], this.y+d[1],this.z+d[2]) } | |
| this.scale = function(s) { return new vec3(s*this.x, s*this.y,s*this.z) } | |
| this.rotz = function(ang) { | |
| var c = Math.cos(ang) | |
| var s = Math.sin(ang) | |
| return new vec3(this.x*c - this.y*s,this.y*c + this.x*s, this.z) |
This file contains hidden or 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: redis-cli publish message hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end |
This file contains hidden or 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 | |
| use Ratchet\MessageComponentInterface; | |
| use Ratchet\ConnectionInterface; | |
| class MyApp1 implements MessageComponentInterface { | |
| public function onOpen(ConnectionInterface $conn) { | |
| } | |
| public function onMessage(ConnectionInterface $from, $msg) { | |
| } |
This file contains hidden or 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 | |
| class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter | |
| { | |
| protected | |
| $rowFormat = "<div class=\"control-group %row_class%\">\n %label%\n <div class=\"controls\">\n %field%\n %error%\n %help%\n %hidden_fields%\n </div>\n</div>\n", | |
| $errorRowFormat = '%errors%', | |
| $errorListFormatInARow = "<span class=\"help-inline\">%errors%</span>\n", | |
| $errorRowFormatInARow = "%error% ", | |
| $namedErrorRowFormatInARow = "%name%: %error% ", | |
| $helpFormat = '<p class="help-block">%help%</p>', |
This file contains hidden or 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
| /* | |
| * Here the 'inspiration': http://goo.gl/OKL9A | |
| * Adapted from: http://psha.org.ru/leaflet/Google.js | |
| * Demo: http://psha.org.ru/leaflet/bel.html | |
| * This code works well with jquerymobile: | |
| * the original code maintain a div.height of 0 for the internal google container | |
| * REMARKS: this | |
| * NOTE: jQuery required! | |
| */ |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains hidden or 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
| // Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core? | |
| L.TileLayer.Common = L.TileLayer.extend({ | |
| initialize: function (options) { | |
| L.TileLayer.prototype.initialize.call(this, this.url, options); | |
| } | |
| }); | |
| (function () { | |
This file contains hidden or 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
| passwd gitlab |
This file contains hidden or 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
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |