Skip to content

Instantly share code, notes, and snippets.

body#-webkit-web-inspector #main{background-color:#002b36!important}body#-webkit-web-inspector #main .panel.network,body#-webkit-web-inspector #main .panel.timeline,body#-webkit-web-inspector #main .panel.profiles,body#-webkit-web-inspector #main .panel.audits,body#-webkit-web-inspector #main .panel.extension{background-color:#fff!important}body#-webkit-web-inspector #console-messages a:hover,body#-webkit-web-inspector #console-messages .console-formatted-function,body#-webkit-web-inspector #console-messages .console-formatted-object{color:#93a1a1!important}body#-webkit-web-inspector #console-prompt,body#-webkit-web-inspector #console-messages a,body#-webkit-web-inspector #console-messages .console-message,body#-webkit-web-inspector #console-messages .console-group-messages .section .header .title{color:#839496!important}body#-webkit-web-inspector #console-messages .console-formatted-null,body#-webkit-web-inspector #console-messages .console-formatted-undefined{color:#657b83!important}body#-webkit-web-inspect
// Don't use it!
var EmitEvent = function(object, events) {
this.object = object;
this.events = events || {};
};
EmitEvent.prototype = {
constructor: EmitEvent,
@monolithed
monolithed / payment.js
Last active December 24, 2015 04:09
Расчет процентов по кредиту
Number.prototype.toCurrency = function() {
return this.toFixed(2).replace(/(\d)(?=(\d{3})+\b)/g,'$1 ');
};
var payment = function (credit, months, rate) {
rate /= 12 * 100;
return {
get day () {
return this.month / 30.4;

How Fast if Git?

The web is full of benchmarks showing the supernatural speed of Git even with very big repositories, but unfortunately they use the wrong variable. Size is not important, but the number of files in the repository really is!

Why is that? Well, that's because Git works in a very different way compared to Synergy. You don't have to checkout a file in order to edit it; Git will do that for you automatically. But at what price?

The price is that for every Git operation that requires to know which files changed (git status, git commmit, etc etc) an lstat() call will be executed for every single file

Wow! So how does that perform on a fairly large repository? Let's find out! For this example I will use an example project, which has 19384 files in 1326 folders.

var p = (function (exports) {
var pipedValue,
pipes = [],
addToPipe = false,
runPipe = function () {
var val = pipedValue, idx;
for (idx in pipes) {
val = pipes[idx](val);
}
@monolithed
monolithed / excel.html
Last active December 28, 2015 11:39
Убогая реализация Excel
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<p>Под вдохновением от <a href="http://thomasstreet.net/blog/spreadsheet.html">http://thomasstreet.net/blog/spreadsheet.html</a>. <br />Особенности:</p>
@monolithed
monolithed / entypo.css
Created November 17, 2013 18:30 — forked from pnull/entypo.css
@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
#!/usr/bin/env python
#-*- coding: iso-8859-1 -*-
################################################################################
#
# Parameter/return value type checking for Python 3000 using function annotations.
#
# (c) 2008-2010, Dmitry Dvoinikov <dmitry@targeted.org>
# Distributed under BSD license.
#
# Samples:
Object.defineProperty(Function.prototype, '__doc__', {
get: function () {
return this.toString();
}
});
var text = function (data) {
/** @return string */
};
~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.css