Skip to content

Instantly share code, notes, and snippets.

#!/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
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
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
#= require ./behaviour
class @GeocodedField extends Behaviour
init: ->
@$latField = @domData('lat-dom')
@$lngField = @domData('lng-dom')
startingValue = @$dom.val()
if startingValue.length > 0
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

Esempio di utilizzo di Grunt

require "virtus"
module Commands
module Base
def self.included(base)
base.extend ClassMethods
base.include Virtus.model
base.include ActiveModel::Validations
base.prepend InstanceMethods
@stefanoverna
stefanoverna / turing.md
Last active August 29, 2015 14:23
Macchine di Turing

Simulatore macchina di Turing

http://morphett.info/turing/turing.html

Consiglio: prima di scrivere la versione "a codice" vi conviene fare il disegnino :)

Macchine di Turing da realizzare

1) Una macchina che arriva alla fine dei dati (0/1) e si ferma

[
{
"name":"Rattata",
"id":19
},
{
"name":"Charmander",
"id":4
},
{
<?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']);
}