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
| var delegate = cui.event.delegate, | |
| dom = cui.dom, | |
| ready = cui.ready; | |
| ready(function(){ | |
| delegate(dom.select("#menu"), 'li a', 'click', function( e ){ | |
| if(window.console) console.log(e.target) |
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
| (function(){ | |
| var timer; | |
| function instaSearch() { | |
| //add loading | |
| cuba.select("#s").addClass("loading") | |
| var q = cuba.select("#s").value[0].value |
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(["cui","dom","event","ajax"], function(cui, dom, event, ajaxobj){ | |
| var sfield = dom.select("#s"), | |
| container = dom.select("#photos"), | |
| timer; | |
| function instaSearch() { | |
| dom.addClass(sfield, "loading") |
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(["cui","dom","event","ajax"], function(cui, dom, event, ajaxobj){ | |
| var sfield = dom.select("#s"), | |
| container = dom.select("#photos"), | |
| timer; | |
| function instaSearch() { | |
| dom.addClass(sfield, "loading") |
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(["ready", "dom", "autosuggest"], function(app, dom, widget){ | |
| var Autosuggest = widget.autosuggest | |
| var suggestions = [ | |
| "ActionScript", | |
| "AppleScript", | |
| "Asp", | |
| "BASIC", | |
| "C", |
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
| #Luhn Python checksum for credit card validation | |
| import sys | |
| def luhn(n): | |
| sum = 0 | |
| alt = 0 | |
| i = len(n) - 1 |
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
| var crypto = require('crypto'); | |
| function sha1( data ) { | |
| var generator = crypto.createHash('sha1'); | |
| generator.update( data ) | |
| return generator.digest('hex') | |
| } | |
| console.log( sha1('adrian') ) |
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
| var sys = require("sys"), | |
| http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs"); | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname; | |
| var filename = path.join(process.cwd(), uri); |
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
| class MyApp < Sinatra::Base | |
| get '/' do | |
| @title = "Home" | |
| erb:index | |
| 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
| require 'rubygems' | |
| require 'bundler' | |
| Bundler.require | |
| require './app.rb' | |
| run MyApp |