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
String::pad = (l, s) -> | |
if (l -= @length) > 0 | |
(s = new Array(Math.ceil(l / s.length) + 1).join(s)).substr(0, s.length) + this + s.substr(0, l - s.length) | |
else | |
@ | |
app = angular.module "yoplayApp", ["ngResource"] | |
app.factory "myHttpInterceptor", ["$q", "$window", "$rootScope", ($q, $window, $rootScope) -> | |
(promise) -> |
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 express from "express" | |
var app = express(); | |
app.get("/", (req, res) => { | |
res.json({hello: 'world'}); | |
}); | |
var port = process.env.PORT || 3000; |
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
# Meassure the difference: | |
# $ ab -r -n 10 http://127.0.0.1:4567/ | grep "Requests per second" | |
require 'sinatra' | |
require 'logger' | |
ERRLOG = Logger.new "#{__FILE__}.err" | |
ERRQ = Queue.new | |
Thread.new do | |
loop do |
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
user:realm:fb6cb9e166c6c764ff2bdea12175a8aa |
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
board = """ | |
........................o........... | |
......................o.o........... | |
............oo......oo............oo | |
...........o...o....oo............oo | |
oo........o.....o...oo.............. | |
oo........o...o.oo....o.o........... | |
..........o.....o.......o........... | |
...........o...o.................... | |
............oo...................... |
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
<a id='clickMe' href='#'>Click me</a> |
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::hasProperties = (properties) -> | |
self = @ | |
self.prototype.properties = {} | |
definePropertie = (key, value) -> | |
self.prototype.properties[key] = value | |
self.prototype[key] = (newValue) -> | |
@properties[key] = newValue | |
@ | |
for key, value of properties | |
definePropertie key, value |
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
var AClass = new Class({ | |
Implements: [ExtendedLogger], | |
initialize: function() { | |
this.initLogger('AClass', { | |
skip: ['silentMethod'], | |
debug: true | |
}); | |
this.silentMethod(); | |
this.otherMethod(); | |
}, |
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
<!DOCTYPE HTML> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Events Flow</title> | |
<style type="text/css" media="screen"> | |
div { | |
background-color: #ddd; | |
padding: 40px; | |
border: 1px solid white; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Media querys IE fallback</title> | |
<style> | |
p { | |
color: blue; | |
} |