Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/usr/bin/env ruby | |
# | |
# Originally written by http://redartisan.com/tags/csv | |
# Added and minor changes by Gavin Laking | |
# Rewritten by Andrew Bennett for Ruby 1.9 | |
# | |
# Usage: ruby csv_to_fixture.rb file.csv [--json] | |
# | |
# "id","name","mime_type","extensions","icon_url" | |
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif" |
alias ack='ack-grep --type-set twig=.twig' |
<?php | |
namespace Acme\DemoBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Security\Core\Role\SwitchUserRole; |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
/** | |
* Quick Ajax Queue Manager | |
* | |
* Inspired by jAndy at Stackoverflow | |
* http://stackoverflow.com/questions/4785724/queue-ajax-requests-using-jquery-queue | |
* | |
*/ | |
var AjaxQ = Class.extend | |
({ |
cd ~ | |
sudo add-apt-repository ppa:dlecan/openjdk | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.7.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
sudo mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
<?xml version="1.0"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | |
<xs:element name="notice"> | |
<xs:complexType> | |
<xs:all> | |
<xs:element name="api-key" type="xs:string"/> | |
<xs:element name="notifier" type="notifier"/> | |
<xs:element name="error" type="error"/> | |
<xs:element name="request" type="request" minOccurs="0"/> |
In order to get a bit of "hard data" on what accessors will actually be used for once they are introduced I wrote a small script that scans through a codebase, finds all getter and setter methods and checks them for various characteristics. (The analyze.php file in this Gist.)
Here are the results of running it on a Symfony (Standard) skeleton.
absoluteTotal => 18516 (486.6%)
total => 3805 (100.0%)
skipped => 124 ( 3.3%)
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
this_dir = File.dirname(__FILE__) + "/" | |
require this_dir + "vagrant/hostmaster.rb" | |
Vagrant::Config.run do |config| | |
# define some colors for our output | |
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end |