A Pen by Captain Anonymous on CodePen.
This file contains hidden or 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 ruby | |
| # encoding: UTF-8 | |
| # | |
| # LearnRubyByExample: | |
| # | |
| # Ruby is a highly expressive programming language. | |
| # Testing software is an expressive way to communicate how it works. | |
| # | |
| # In the middle of a night awake for allergy and insomnia, and some days after the 1st _why day, | |
| # I've tried to combine Ruby and testing to help teaching ruby with some goals in mind: |
This file contains hidden or 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
| framework 'Cocoa' | |
| framework 'WebKit' | |
| class Cat | |
| attr_accessor :name, :age | |
| def initialize(name = 'kitty', age=42) | |
| @name = name | |
| @age = age | |
| end | |
This file contains hidden or 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
| ActiveRecord::Schema.define(:version => 20100824224246) do | |
| create_table "users", :force => true do |t| | |
| t.string "name" | |
| t.text "friend_list" | |
| t.datetime "created_at" | |
| t.datetime "updated_at" | |
| end | |
| end |
This file contains hidden or 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
| Rails.application.config.to_prepare do | |
| SubscriptionPlan.class_eval do | |
| scope :active, where(:active => true) | |
| scope :by_price, order(:amount) | |
| end | |
| end |
This file contains hidden or 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
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
This file contains hidden or 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
| <!-- Physics shaders --> | |
| <script id="physics-vert" type="x-vertex-shader"> | |
| attribute vec2 aVertexPosition; | |
| void main() { | |
| gl_Position = vec4( aVertexPosition, 1, 1 ); | |
| } |
This file contains hidden or 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
| <link href='http://fonts.googleapis.com/css?family=Droid+Sans:700|Droid+Serif' rel='stylesheet' type='text/css'> | |
| <div id="banner"> | |
| <div id="bannertext"> | |
| <h1>PARAL & LAX</h1> | |
| <p>Finest webdesign since 1870</p> | |
| </div> | |
| </div> | |
| <div id="content"> |
This file contains hidden or 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
| // Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
| // jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
| // author: Pawel Kozlowski | |
| var myApp = angular.module('myApp', []); | |
| //service style, probably the simplest one | |
| myApp.service('helloWorldFromService', function() { | |
| this.sayHello = function() { | |
| return "Hello, World!" |
This file contains hidden or 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
| #En una consola ... | |
| rails new prueba | |
| cd prueba | |
| rails g scaffold factura referencia:string | |
| rails g scaffold factura_linea importe:decimal factura_id:integer | |
| rake db:migrate | |
| # Modificamos los modelos |
OlderNewer