Esempio di utilizzo di Grunt
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
#!/usr/bin/env bash | |
# Usage: cached-bundle install --deployment | |
# | |
# After running `bundle`, caches the `vendor/bundle` directory to S3. | |
# On the next run, restores the cached directory before running `bundle`. | |
# When `Gemfile.lock` changes, the cache gets rebuilt. | |
# | |
# Requirements: | |
# - Gemfile.lock | |
# - REPO_SLUG |
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
module I18n | |
def self.missing_keys | |
@missing_keys | |
end | |
def self.t(*args, &block) | |
opts = args.dup.extract_options! | |
opts[:default] = Array(opts[:default]).delete_if do |d| | |
d.is_a? String | |
end |
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
class CreateBooking | |
class LimitReached < RuntimeError; end | |
class AlreadyBooked < RuntimeError; end | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
attr_reader :slot_id | |
attr_reader :book_cart |
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
#= require ./behaviour | |
class @GeocodedField extends Behaviour | |
init: -> | |
@$latField = @domData('lat-dom') | |
@$lngField = @domData('lng-dom') | |
startingValue = @$dom.val() | |
if startingValue.length > 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
require 'kss' | |
styleguide = Kss::Parser.new('app/assets/stylesheets') | |
puts styleguide.sections | |
module Renderer | |
def self.render options = {} | |
assigns = options.delete(:assigns) || {} | |
view = view_class.new ActionController::Base.view_paths, assigns | |
view.extend ApplicationHelper | |
view.extend CustomHelper |
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
require "virtus" | |
module Commands | |
module Base | |
def self.included(base) | |
base.extend ClassMethods | |
base.include Virtus.model | |
base.include ActiveModel::Validations | |
base.prepend InstanceMethods |
http://morphett.info/turing/turing.html
Consiglio: prima di scrivere la versione "a codice" vi conviene fare il disegnino :)
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
[ | |
{ | |
"name":"Rattata", | |
"id":19 | |
}, | |
{ | |
"name":"Charmander", | |
"id":4 | |
}, | |
{ |
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 | |
function gsa_theme_page() { | |
if (isset($_POST['info_update'])){ | |
if ( isset($_POST['headerimage']) ) { | |
if ( '' == $_REQUEST['headerimage'] ) | |
delete_option('gsa_header_image'); | |
else { | |
update_option('gsa_header_image', $_REQUEST['headerimage']); | |
} |
OlderNewer