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
| struct Person { | |
| Age $age; | |
| Address $address; | |
| HairColor $hairColor; | |
| Length $height?; // optional? not sure if worth it | |
| } | |
| $yitz = Person( | |
| $age => new Age(30), | |
| $address => $someAddress, |
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
| <html> | |
| <head></head> | |
| <body> | |
| <div id="map-canvas" style="height: 600px; width: 600px;"></div> | |
| <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_GOOGLE_MAPS_API_KEY_HERE"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
| <script> | |
| var positionToStarbucksLatlng = function(position) { |
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
| (define (pascal row col) | |
| (define (row_underflow? col) (< col 0)) | |
| (define (row_overflow? row col) (> col row)) | |
| (define (initial_cell? row) (= row 0)) | |
| (cond | |
| ((row_underflow? col) 0) | |
| ((row_overflow? row col) 0) | |
| ((initial_cell? row) 1) | |
| (else |
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
| # evil | |
| module MoarMethods | |
| def foo | |
| end | |
| def bar | |
| end | |
| 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
| .issue-link[title]:after { | |
| content:attr(title); | |
| font-size: 0.8em; | |
| margin-left: 0.4em; | |
| margin-right: 0.6em; | |
| padding: 0.2em 0.4em; | |
| border: 1px solid #ccc; | |
| background: #eee; | |
| color: #777; | |
| position: relative; |
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 git_checkout | |
| { | |
| REF=$(git symbolic-ref HEAD 2> /dev/null) | |
| HASH=$(git rev-parse --short HEAD 2> /dev/null) || return | |
| if [ -n "$REF" ] ; then echo "("${REF#refs/heads/}") " ; | |
| elif [ -n "$HASH" ] ; then echo "("${HASH}") " ; | |
| fi | |
| } | |
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
| brew install rbenv rbenv-gemset rbenv-bundler ruby-build | |
| # add $HOME/.rbenv/bin to $PATH | |
| echo 'eval "$(rbenv init -)"' >> ~/.bash_profile # to enable shims and auto-complete | |
| rbenv install ruby-2.1.3 # or other desired/current version | |
| # change to your project dir, then: | |
| echo '.gems' > .rbenv-gemsets | |
| rbenv local 2.1.3 | |
| gem install bundler |
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
| define(function() { | |
| 'use strict'; | |
| function TrelloboardRepository($q) { | |
| this.$q = $q; | |
| } | |
| TrelloboardRepository.prototype = { | |
| find: function() { | |
| // first iteration: just return a hard-coded Trelloboard |
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 Foo | |
| { | |
| private $bar; | |
| public function bar($newBar = null) | |
| { | |
| if ($newBar !== null) { | |
| $this->bar = $newBar; |
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 | |
| function get_projects(ApiClient $api) | |
| { | |
| $projectList = []; | |
| foreach ($api->getProjects(['limit' => 200]) as $project) { | |
| $projectList[$project->getId()] = $project->getData()->name; | |
| } | |