Skip to content

Instantly share code, notes, and snippets.

View FCO's full-sized avatar

Fernando Correa de Oliveira FCO

View GitHub Profile
<!DOCTYPE html>
<html>
<!--
Created using jsbin.com
Source can be edited via http://jsbin.com/OtIfiFEw/1/edit
-->
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<link href="http://getbootstrap.com/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
@FCO
FCO / SDK.js
Created October 24, 2015 18:24
var CommandWS = require("CommandWS.js");
function TWS(url) {
this.cws = new CommandWS(url);
this.apiKey = null,
this.authKey = null;
this.cws.on("open", function() {
this.setApiKey("1234");
this.login("smokemachine", "12345", function(error, cmd) {
// you are logged in!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>OLX</title>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
#outlook a {padding:0;}
body{width:100% !important; margin:0; padding:0; font-family: 'Open sans', sans-serif; color:#5c5c5c; background: #f7f9f9;}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>OLX</title>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Open+Sans);
#outlook a {padding:0;}
body{width:100% !important; margin:0; padding:0; font-family: 'Open sans', sans-serif; color:#5c5c5c; background: #f7f9f9;}
when I get a instance of a singleton inside of a trait_mod code, I get a object and when I get it on a regular code I get a different object... is that expected?
MacBook-Pro-de-Fernando:artigo fernando$ cat Fuzz.pm6
class Test::Fuzz {...}
my $instance = Test::Fuzz.bless;
class Test::Fuzz {
method new {!!!}
method instance(::?CLASS:U:) {
MacBook-Pro-de-Fernando:test fernando$ cat ToUse.pm6
unit class ToUse;
has %!bla;
my $instance = ::?CLASS.bless;
method new {!!!}
method instance {
$instance
}
method getBla is export {
MacBook-Pro-de-Fernando:test fernando$ cat ToUse.pm6
unit class ToUse;
has %!bla;
my $instance = ::?CLASS.bless;
method new {!!!}
method instance {
$instance
}
method getBla is export {
OK! So I wrote my code and it's looking good. There's my incredible sum function:
module Sum {
sub sum($a, $b) is export {
$a + $b
}
}
Great, isn't it?! Let's use it:
use Sum;
OK! So I wrote my code and it's looking good. Here's my incredible sum function:
module Sum {
sub sum($a, $b) is export {
$a + $b
}
}
Great, isn't it?! Let's use it:
use Sum;
OK! So I wrote my code and it's looking good. Here's my incredible sum function:
module Sum {
sub sum($a, $b) is export {
$a + $b
}
}
Great, isn't it?! Let's use it:
use Sum;