Skip to content

Instantly share code, notes, and snippets.

@Siedrix
Siedrix / bower.json
Created July 20, 2014 23:42
Example of Backbone and React working together
{
"name": "backbone-react-example",
"version": "1.0.0",
"authors": [
"Siedrix <Siedrix@gmail.com>"
],
"description": "backbone react todo list",
"license": "MIT",
"dependencies": {
"backbone": "~1.1.2",
@Siedrix
Siedrix / bower.json
Created August 24, 2014 21:47
Backbone urls
{
"name": "url-patterns",
"version": "0.0.0",
"authors": [
"Siedrix <Siedrix@gmail.com>"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
@Siedrix
Siedrix / add-register.py
Created September 7, 2014 21:21
Redbird example with adding host with redis
import redis
import json
register = {
"src" : "nodebots-dev.mx",
"target" : "http://127.0.0.1:4500/"
}
registerAsStr = json.dumps(register)
@Siedrix
Siedrix / backbone.widget.js
Last active August 29, 2015 14:09
Backbone.Widget
Backbone.Widget = function() {
this.initialize.apply(this, arguments);
};
_.extend(Backbone.Widget.prototype, Backbone.Events, {
initialize : function(){},
});
Backbone.Widget.extend = Backbone.View.extend;
function randString(){
$n = 20;
$characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string = "";
$l = strlen($characters);
for ($i = 0; $i < $n; $i++) {
$string .= $characters[rand(0, $l)];
}
@Siedrix
Siedrix / wp-app.js
Created December 18, 2011 02:38
Web server for android
var WebSocket = require('faye-websocket'),
http = require('http'),
express = require('express');
var app = express.createServer()
app.get('/', function(req, res){
res.send('Hello World');
});
@Siedrix
Siedrix / App.js
Created December 27, 2011 06:10
RequireJs on Node
var requirejs = require('requirejs');
requirejs.config({
baseUrl: 'scripts',
nodeRequire: require
});
requirejs(['bar'],
function ( bar ) {
console.log('bar: ', bar);
@Siedrix
Siedrix / Sample app
Created April 24, 2012 04:46
Lokijs sample app
(function(global){
var app = global.app = new Loki();
Class(Loki.Views, 'ListView').inherits(Loki.View)({
templateUrl : 'templates/main.html',
templateMap : {
slug : '#description',
link : '#more a[href=/link/{:id}]'
},
prototype : {
@Siedrix
Siedrix / Output
Created June 10, 2012 17:22
Bdpn package.json
/bdpn-node$ jitsu deploy
info: Welcome to Nodejitsu siedrix6
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in app.js
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/siedrix/bdpn-node/package.json
warn: Using '*' as version for dependencies may eventually cause issues.
warn: Please use specific versions for dependencies to avoid future problems.
@Siedrix
Siedrix / key.json
Created August 10, 2012 00:28
Key bindings Sublime text
[
{ "keys": ["ctrl+u", "ctrl+i"], "command": "insert_snippet", "args": {"contents": "console.log('$SELECTION',$SELECTION);"} },
{ "keys": ["ctrl+u", "ctrl+o"], "command": "insert", "args": {"characters": "console.log();"} },
{ "keys": ["ctrl+u", "ctrl+p"], "command": "insert", "args": {"characters": "debugger;"} }
]