Skip to content

Instantly share code, notes, and snippets.

View azproduction's full-sized avatar

Mikhail Davydov azproduction

View GitHub Profile
@azproduction
azproduction / index.html
Created February 23, 2011 09:26
LocalStorage broadcast
<body>
<h1>localStorage window broadcast example</h1>
<script>
function openwindows(n){
var h = window.screen.height / n,
w = window.screen.width / n, i, j;
for (i = 0; i < n; i += 1) {
for (j = 0; j < n; j += 1) {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Let - FF Only</title>
</head>
<body>
<script type="application/javascript;version=1.7">
(function () {
for (var x = 0, data = []; x < 3; x++) {
@azproduction
azproduction / LICENSE.txt
Created May 24, 2011 19:16 — forked from 140bytes/LICENSE.txt
Desktop browser detection script
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 azproduction
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
var MyObject = function (url, req, res, path, body) {
this.res = res; // Object
this.req = req; // Object
this.body = body; // String
this.url = url; // Object
this.method = req.method; // String
this.get = url.query; // Object
this.path = path || {}; // Object
};
@azproduction
azproduction / LICENSE.txt
Created August 3, 2011 16:10 — forked from 140bytes/LICENSE.txt
Browser detection script v3.0
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 azproduction
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@azproduction
azproduction / check_then_throw_error.js
Created August 9, 2011 11:26
What the ideologically better for JavaScript?
function onlyStringArgument(string) {
if (typeof string !== "string") {
throw new Error('string must be a string');
}
return string.split(';');
}
onlyStringArgument(42);
@azproduction
azproduction / gist:1292557
Created October 17, 2011 13:03
Simple Google Dart HTTP Server
/**
* Simple HTTP server on Dart
* @see http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/runtime/bin/socket_impl.dart
* http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/runtime/bin/socket_stream.dart
*
* Based on http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/samples/socket/SocketExample.dart
* @author azproduction
*/
class HttpExample {
@azproduction
azproduction / LICENSE.txt
Created October 31, 2011 12:44 — forked from 140bytes/LICENSE.txt
DoF and frame params calculator
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 azproduction http://azproduction.ru/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@azproduction
azproduction / decurl.js
Created November 2, 2011 07:56
Callback chain killer [prototype]
var doit = new Do();
function doSmth(cb) {
cb(null, {});
}
function doSmth2(cb) {
doit.result; // Тут все ответы
doit.previousResult; // Тут ответ предыдущей функции
cb(null, {});
@azproduction
azproduction / LICENSE.txt
Created November 28, 2011 14:03 — forked from 140bytes/LICENSE.txt
A turing machine in 79! bytes of javascript
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE