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
| typedef struct { | |
| float hue; | |
| float saturartion; | |
| float value; | |
| } hsv; | |
| long hsv_to_rgb(hsv color) { | |
| return 0xff0000; | |
| } |
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
| # -*- encoding: utf-8 -*- | |
| require 'test/unit' | |
| require 'set_assertions' | |
| class SetAssertionsTest < Test::Unit::TestCase | |
| def test_two_empty_tests_pass | |
| assert_identical_set([],[]) | |
| 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
| irb(main):011:0> a = %w{aye bee cee} | |
| => ["aye", "bee", "cee"] | |
| irb(main):012:0> a.one? { false } | |
| => false | |
| irb(main):013:0> a.one? { true } | |
| => false | |
| irb(main):014:0> a.one? { |v| v == "aye" } | |
| => true | |
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
| gem("sass-rails", '~> 3.1') | |
| gem ('bootstrap-sass', '~> 2.0.2') | |
| application do | |
| "config.active_record.whitelist_attributes = true" | |
| 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
| def to_json opts = {} | |
| result = {} | |
| each { |attr, message| result[attr] ||= []; result[attr] << message } | |
| result.to_json opts | |
| 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
| require "rubygems" | |
| require "amqp" | |
| require 'msgpack' | |
| require 'base64' | |
| require "em-apn" | |
| EXCHANGE = "push_notification" | |
| AUTO_DELETE = false | |
| DURABLE = true | |
| ROUTING_KEY = "apple" |
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
| var sys = require('sys'); | |
| var amqp = require('amqp'); | |
| var connection = amqp.createConnection({ host: 'rash.local' }); | |
| // Wait for connection to become established. | |
| connection.on('ready', function () { | |
| // Create a queue and bind to all messages. | |
| // Use the default 'amq.topic' exchange | |
| var q = connection.queue('my-queue'); |
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
| package userEditorModule.service.user { | |
| import com.visfleet.common.service.FormatEnumeration; | |
| import com.visfleet.common.service.resourceClient.CollectionResource; | |
| import com.visfleet.common.service.vWorkResourceClient.actions.CreateAction; | |
| import com.visfleet.common.service.vWorkResourceClient.actions.DeleteAction; | |
| import com.visfleet.common.service.vWorkResourceClient.actions.NewAction; | |
| import com.visfleet.common.service.vWorkResourceClient.actions.ShowAction; | |
| import com.visfleet.common.service.vWorkResourceClient.actions.UpdateAction; | |
| import flash.events.IEventDispatcher; |
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
| module A | |
| class << self | |
| attr_accessor :name | |
| def make_funny | |
| "funny #{@name}" | |
| end | |
| 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
| public class UserService extends RailsServiceBase implements VOSerializingService, VOBuildingService { | |
| private var _dx:VOBuilder; | |
| private var _sx:VOSerializer; | |
| public var createAction:CreateAction = new CreateActionImpl(this); // SerializeService, DeserializeService | |
| public var updateAction:UpdateAction = new UpdateActionImpl(this); // SerializeService | |
| public var newAction:NewAction = new NewActionImpl(this); // Deserialize | |
| public var showAction:ShowAction = new ShowActionImpl(this); // Deserialize | |
| public var deleteAction:DeleteAction = new DeleteActionImpl(this); |