Skip to content

Instantly share code, notes, and snippets.

☀️
hablo programación

Przemek Sobstel sobstel

☀️
hablo programación
Block or report user

Report or block sobstel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ludekstepan
ludekstepan / MigrationExample.php
Created Sep 20, 2012
Example of container aware migration
View MigrationExample.php
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20120920130854 extends AbstractMigration
{
public function up(Schema $schema)
View yardoc_cheatsheet.md

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

# Namespace for classes and modules that handle serving documentation over HTTP
View oo.php
<?php
// Define the 'class' class
$class = Obj()
->fn('new', function ($class) {
$newClass = Obj($class->methods)
->fn('new', function($class) {
$obj = Obj($class->imethods);
$args = func_get_args();
array_shift($args);
View form_builder_helpers.rb
module FormBuilderHelpers
class Html5
def self.options_from(object, attribute)
return {} unless object.class.respond_to?(:validators_on)
{}.tap do |options|
options[:required] = true if object.class.validators_on(attribute).any? { |validator| validator.is_a?(ActiveModel::Validations::PresenceValidator) }
if validator = object.class.validators_on(attribute).select { |validator| validator.is_a?(ActiveModel::Validations::InclusionValidator) && validator.options[:in].is_a?(Range) }.last
options[:min] = validator.options[:in].min
You can’t perform that action at this time.