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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
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 | |
namespace Application\BaseBundle\Doctrine\Listener; | |
use Doctrine\ORM\Event\LoadClassMetadataEventArgs; | |
class InheritanceMapping | |
{ | |
protected $mappings; |
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
# web/blog/.htaccess (wordpress core resides in web/blog/wordpress) | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /blog/ | |
# Redirect wordpress dir | |
RewriteRule ^wordpress/?$ . [R=301,L] |
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 | |
namespace WiredMedia\CatalogBundle\Request\ParamConverter; | |
use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface; | |
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
use Symfony\Component\HttpFoundation\Request; | |
use Doctrine\Common\Persistence\ManagerRegistry; |
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 | |
$linode = array('server-name' => '1.2.3.4'); | |
$rackspace = array('server-name' => '1.2.3.4'); | |
foreach (array('linode' => $linode, 'rackspace' => $rackspace) as $stack => $servers) { | |
foreach ($servers as $server => $ip) { | |
$data = file_get_contents(sprintf('http://www.spamhaus.org/query/ip/%s', $ip)); | |
echo sprintf('%s (%s) - %s', $server, $stack, $ip), PHP_EOL; |
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
# Project | |
set :application, "ProjectName" | |
set :repository, "git@github.com:changeme/#{application}.git" | |
set :db_dev, "database_name_dev" | |
# Tasks | |
## Standard |
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 Post extends \WPUF_Add_Post { | |
function __construct() { | |
remove_shortcode('wpuf_addpost'); | |
add_shortcode('wpuf_addpost', array($this, 'shortcode')); | |
} | |
function post_form($post_type) { | |
$reflection = new \ReflectionMethod('WPUF_Add_Post', 'post_form'); |
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 blam(sentiment) { | |
var sentiment = sentiment || null; | |
$('input:text, textarea').each(function() { | |
$(this).val('Generic ' + sentiment + '\'ve input!'); | |
}); | |
$('.question:contains("Email") input:text').val('fake@simpleweb.co.uk'); | |
$('.date-picker').val('October 08, 2014'); |
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
Show hidden characters
{ | |
"auto_complete_commit_on_tab": true, | |
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme", | |
"detect_slow_plugins": false, | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"draw_minimap_border": true, | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
"._*", |
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
set :user, "my-ssh-user" | |
set :db, YAML::load(IO.read("config/database.yml")) # assumes rails | |
namespace :db do | |
desc "Push database" | |
task :push do | |
run_locally do | |
db = fetch(:db) | |
env = fetch(:rails_env) | |
server = fetch(:server) |