Moved to repository: https://github.com/Mailcloud/swift-serializer
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
using { /Verse.org/Random } | |
Array<public> := module: | |
# Makes an `array` with only unique elements | |
(Input:[]t where t:subtype(comparable)).Unique<public>()<transacts>:[]t = | |
var UniqueArray : []t = array{} | |
for (Value : Input): | |
if (UniqueArray.Find[Value] > -1) {} | |
else: |
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
using { /Fortnite.com/Devices } | |
using { /Fortnite.com/Characters } | |
using { /Verse.org/Simulation } | |
using { /UnrealEngine.com/Temporary/Diagnostics } | |
using { /UnrealEngine.com/Temporary/SpatialMath } | |
GetClosestPlayerToProp(AllPlayers: []fort_character, Prop : creative_prop): ?fort_character = | |
var ClosestPlayer : ?fort_character = false | |
var ClosestDistance: float = 1000000000.0 # initialize with a large number | |
for (Player : AllPlayers): |
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
#ThermoZztat | |
# These are example segments meant to be copied into the 3 main files. | |
############### Examples for Configuration.yaml ############### | |
switch: | |
- platform: mqtt | |
name: "Upstairs Fan" | |
command_topic: "cmnd/ThermoZztat/POWER1" | |
state_topic: "stat/ThermoZztat/POWER1" | |
qos: 1 |
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
1. Copy some JSON to your clipboard. Need some JSON? Here you go http://goo.gl/mWZSEL | |
2. In Visual Studio, right-click your project and select Add->Class. | |
3. Highlight the following code in your class: | |
class Class1 | |
{ | |
} | |
4. From the top menu, select Edit->Paste Special->Paste JSON as Classes. | |
5. Rename "Rootobject" to your desired class name. Done! |
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
# Generate a backtrace string for given exception. | |
# Generated string is a series of lines, each beginning with a tab and "at ". | |
def pretty_backtrace(exception) | |
"\tat #{exception.backtrace.join("\n\tat ")}" | |
end | |
# Generate a string containing exception message followed by backtrace. | |
def pretty_exception(exception) | |
"#{exception.message}\n#{pretty_backtrace(exception)}" | |
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
// | |
// API.swift | |
// | |
// Created by Taro Minowa on 6/10/14. | |
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved. | |
// | |
import Foundation | |
typealias JSONDictionary = Dictionary<String, AnyObject> |
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
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AS": "American Samoa", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", |
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
# db/migrations/20120118012543_create_site_configuration.rb | |
class CreateSiteConfigurations < ActiveRecord::Migration | |
def change | |
create_table :site_configurations do |t| | |
t.string :key | |
t.text :value | |
t.string :form_type | |
t.string :form_collection_command |
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 BootstrapFormBuilder < ActionView::Helpers::FormBuilder | |
delegate :capture, :content_tag, :tag, to: :@template | |
%w[text_field text_area password_field collection_select].each do |method_name| | |
define_method(method_name) do |name, *args| | |
errors = object.errors[name].any?? " error" : "" | |
error_msg = object.errors[name].any?? content_tag(:span, object.errors[name].join(","), class: "help-inline") : "" | |
content_tag :div, class: "clearfix#{errors}" do |
NewerOlder