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
import ceylon.language.meta { | |
type | |
} | |
import ceylon.language.meta.declaration { | |
ValueDeclaration | |
} | |
import ceylon.language.meta.model { | |
Attribute | |
} |
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
# Welcome to Sonic Pi v2.9 | |
Chord = Struct.new(:tonic, :scale, :degree, :duration) | |
def run_pattern(pattern, duration) | |
pattern.each do |b| | |
play yield if b == 1 or b == true | |
sleep (duration / pattern.length) | |
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
type NodeID = int | |
type EdgeData = | |
| AddEdge of int | |
| SetEdge of int | |
type Edge = NodeID * NodeID * EdgeData | |
type Tree = Map<NodeID, Edge list> |
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
let manage_socket (socket : System.Net.WebSockets.WebSocket) = | |
async { | |
printfn "Managing socket." | |
let! token = Async.CancellationToken | |
let buffer = System.Net.WebSockets.WebSocket.CreateServerBuffer(2048) | |
let rec loop cont = | |
if cont then | |
let break_on_exception thunk = | |
try | |
thunk() |
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
open Core.Std | |
module type G = sig | |
type node_data | |
type edge_data | |
module rec Node : sig | |
type t with sexp | |
val compare : t -> t -> int |
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
Object.prototype.descriptor = function (property) { | |
"use strict"; | |
var self = this; | |
var property_descriptor; | |
var refresh_descriptor = function () { | |
"use strict"; | |
property_descriptor = Object.getOwnPropertyDescriptor(self, property) || { | |
enumerable: true, | |
configurable: 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
require 'json' | |
module Observable | |
def self.included(mod) | |
class << mod | |
attr_reader :__metadata__ | |
end | |
mod.class_eval do | |
self.define_singleton_method(:observed_writer) do |*names| | |
names.each do |name| |
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 | |
require 'optparse' | |
def run! | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: #{$0} [options]" | |
opts.on('-a', '--assignee ASSIGNEE', 'IEEE Assignee') do |assignee| |
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
# Example: | |
# | |
# class VersionableTest | |
# include Versionable | |
# | |
# versioned_accessor :cheese, :mustard | |
# | |
# def initialize(val) | |
# @cheese = val | |
# @mustard = nil |
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
# Based on Aversion module by txus | |
# https://github.com/txus/aversion | |
# | |
# Example: | |
# | |
# class VersionableTest | |
# include Versionable | |
# | |
# versioned_accessor :cheese | |
# |
NewerOlder