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
import { SM, Clazz } from "./typed_state_machines" | |
interface ITalker { | |
say_hello(name: string): string | |
repeat(message: string) | |
} | |
// the root state is implemented by a class that extends SM (State Machine) | |
class Talker extends SM implements ITalker { | |
say_hello(name: string): string { |
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
import * as fs from "fs-extra" | |
import { ensureDirSync } from "fs-extra" | |
import { LazyGetter as lazy } from "lazy-get-decorator" | |
import { Memoize as memo } from "lodash-decorators" | |
import { dirname, join } from "path" | |
import vscode from "vscode" | |
import { degit_with_retries } from "../../../degit/degit_with_retries" | |
import { GitURL } from "../../../git/GitURL" | |
import { TargetDirSpecification } from "../../util/TargetDirSpecification" | |
import { TargetDirSpecification_resolve_vsc } from "../../util/TargetDirSpecification_resolve_vsc" |
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
@prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
<#me> foaf:name "Aldo Bucchi" ; | |
foaf:member <http://dbpedia.org/resource/MuleSoft> ; | |
foaf:knows <https://gist.githubusercontent.com/blakeembrey/d292d0d182947932114a/raw/me.ttl#me> | |
. |
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 How-to | |
Everybody knows what **looping** over a collection is. But do you know what **reducing** a collection means? | |
No? Are you sure? | |
It sounds scary. But it is in fact pretty simple. You do it all the time. | |
Here. Let me show you an example: | |
<!--code lang=javascript linenums=true--> |
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
I, Aldo Bucchi, have read and do accept the MuleSoft Contributor Agreement | |
at http://www.mulesoft.org/legal/contributor-agreement.html | |
Accepted on Wed Dec 24 2014 17:57:06 GMT-0300 (CLST) |
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
radioactive.react(function(){ | |
var userId = getTextInputValue(); | |
var userName = getNameFromServer( userId ); | |
console.log( userName ); | |
}) |
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
package radioactivejs | |
import org.scalajs.dom | |
import _root_.util.StackVal | |
import org.scalajs.dom.{Event, HTMLElement} | |
import scala.collection.mutable | |
import scala.util.Try | |
import scala.scalajs.js | |
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
object x { | |
// stream a sql query | |
def sql( str:String ):Stream[ResultSet] = withStatement { s => | |
val rs = s executeQuery str | |
new Iterator[ResultSet] { def hasNext = rs.next ; def next = rs }.toStream | |
} | |
// loan a sql statement |
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
function _map( coll, f ){ | |
var res = [] | |
var isIterator = ( typeof coll.next == "function" ) | |
var isArray = ( coll instanceof Array ) | |
var hasFunc = ( typeof f == "function" ) | |
var append = function(e){ res.push( hasFunc ? f(e) : e ) } | |
if( isIterator ){ | |
while( coll.hasNext() ){ append( coll.next() ) } | |
} else if ( isArray ) { | |
coll.forEach(append) |
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.forName(c).getProtectionDomain.getCodeSource.getLocation() |
NewerOlder