Skip to content

Instantly share code, notes, and snippets.

@cayasso
cayasso / Select.js
Created February 20, 2017 22:56
Select Issue in Svelte
<select ref:select on:change="doChange(event)">
<option value="{{item.key}}">{{item.title}}</option>
<option value="two">Two</option>
<option value="three">Three</option>
</select>
<div>Selected Value: {{value}}</div>
<script>
export default {
@cayasso
cayasso / fail.html
Last active December 22, 2015 09:29
Socket.IO port issues, when connecting from domain with different port than 80 to a 80 port domain.
<!Doctype html>
<html lang="en">
<head>
</head>
<body>
<h1>Socket Test</h2>
<script src="http://localhost/socket.io/socket.io.js"></script>
@cayasso
cayasso / monitor.js
Created April 12, 2013 09:22
bid.io-monitor main file.
/**
* Monitor contstructor.
*
* @param {Object} io the SocketIO object
* @param {Object} bio BidIO object
* @param {Object} options monitor options
* @api public
*/
function Monitor (io, bio, options) {
@cayasso
cayasso / LeafletMap.js
Created October 31, 2012 17:15
Leaflet Map for enyo
enyo.kind({
name: "LeafletMap",
classes: "leaflet-map",
published: {
center: { lat: 33.7489, lng: -84.3881},
showMarker: true,
zoom: 17,
// point imagePath to your leaflet images folder
imagePath: "lib/extra/leaflet/images/",
cloudmadeApiKey: "",
@cayasso
cayasso / app.js
Created October 14, 2012 05:53 — forked from bobbydavid/app.js
socket.io in Express 3
var express = require('express')
, http = require('http')
, connect = require('connect')
, io = require('socket.io');
var app = express();
/* NOTE: We'll need to refer to the sessionStore container later. To
* accomplish this, we'll create our own and pass it to Express
* rather than letting it create its own. */
var sessionStore = new connect.session.MemoryStore();
@cayasso
cayasso / jsfunction.html
Created June 13, 2012 21:13
with execute
<html>
<head>
<script>
// Assuming this is the namespace root for myatc
var myatc = {};
// then somewhere global
myatc.saveCar = function () {
@cayasso
cayasso / toolbar.html
Created June 13, 2012 20:29
jsFunction
<html>
<head>
<script>
// Assuming this is the namespace root for myatc
var myatc = {};
// then somewhere global
myatc.saveCar = function () {
// con solo prototype extend
var Persona = Class.extend('Persona', {
saludar: function () {
return 'my method';
}
})
var adulto = Persona();
console.log(adulto.saludar()); // my method
@cayasso
cayasso / getById
Created January 22, 2012 09:00
My Get By ID
<!DOCTYPE html>
<html>
<head>
<title>BFS</title>
</head>
<body>
<div>
<em>
@cayasso
cayasso / DOMtraversal.html
Created January 22, 2012 08:44
My custom getElementById
<!DOCTYPE html>
<html>
<head>
<title>BFS</title>
</head>
<body>
<div>
<em>