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
// html | |
<div>This is my post</div> | |
<!-- Just put this div at the bottom of your template somewhere--> | |
<!-- Notice that its hidden by default, so if it doesnt get used, thats fine--> | |
<div class="modal hide"></div> | |
//JS | |
$.ajax({ | |
type: 'post', // or post? |
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
.well { | |
border: 1px solid #ccc; | |
.border-radius(6px 6px 0 0); | |
.box-shadow(0px 0px 0px 1px #eee); | |
header { | |
.border-radius(6px 6px 0 0); | |
#gradient > .vertical(@navbarBackground, #ddd ); | |
margin: -19px -19px 20px -19px; | |
border-bottom: 1px solid #ccc; | |
padding: 10px; |
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
<?php | |
// I have Groups. A group can have many discussions. A single discussion can have many posts. | |
// models/Group.php | |
public function delete() | |
{ | |
// Check for discussions belonging to the group first | |
if ($this->discussions) { | |
foreach ($this->discussions as $discussion) { | |
$discussion->delete(); | |
} |
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
// Clone L4 repo | |
git clone -b develop git://github.com/laravel/laravel.git myapp | |
cd myapp | |
// Install Composer | |
curl -sS https://getcomposer.org/installer | php | |
php composer.phar install | |
// Rename origin | |
git remote rename origin upstream |
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
position: absolute; top:0; bottom:0; |
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
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
exec $SHELL -l | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
rbenv install 2.0.0-p0 | |
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash | |
rbenv rehash | |
rbenv global 2.0.0-p0 | |
gem install rails --no-ri --no-rdoc |
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
<?php | |
class Container | |
{ | |
protected $registry = []; | |
// Typehint Closure to show expected object | |
public function bind($name, Closure $closure) | |
{ | |
// Populate $registry array with passed-in $closure | |
$registry[$name] = $closure; |
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
<?php | |
// Define the methods that must be implemented | |
interface MailerInterface | |
{ | |
public function addEmail($email); | |
public function send(); | |
} | |
// Implement the Interface methods in this class |
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
// Generated on 2013-10-02 using generator-angular 0.4.0 | |
'use strict'; | |
var LIVERELOAD_PORT = 35729; | |
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }); | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer