Skip to content

Instantly share code, notes, and snippets.

View listochkin's full-sized avatar

Андрей Листочкин (Andrei Listochkin) listochkin

View GitHub Profile
* {
font-family: 'Source Code Pro';
}
p {
font-size: 30px;
color: gray;
}
input {
@listochkin
listochkin / timsort.java
Created March 29, 2016 10:44
Port of original Timsort from Python by Josh Bloch
// See the original at http://cr.openjdk.java.net/~martin/webrevs/openjdk7/timsort/raw_files/new/src/share/classes/java/util/TimSort.java
// and the original description at http://svn.python.org/projects/python/trunk/Objects/listsort.txt
/*
* Copyright 2009 Google Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
@listochkin
listochkin / README.md
Last active May 31, 2016 22:45 — forked from thequux/README.md
Multirust-compatible racer wrapper with OS X support

This wrapper automatically sets the RUST_SRC_DIRECTORY environment variable for whatever rust compiler is currently active, automatically creating a new checkout whenever necessary. This should be compatible with all of the multirust-alike tools, but it has only been tested with rustup.rs

Installation

Simply place this somewhere on your path before the main racer binary and set the execute bit.

Uninstallation

@listochkin
listochkin / martin.js
Created June 7, 2016 15:25
Put it into a console :)
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+
@listochkin
listochkin / 0 Private members in JavaScript.md
Created December 19, 2012 11:04
Private members in JavaScript

Private members in JavaScript

@listochkin
listochkin / index.html
Created November 24, 2016 12:35
React Hello World without a build
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@latest/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@latest/dist/react-dom.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
</head>
<body>
@listochkin
listochkin / playing-with-rust.md
Created January 4, 2015 10:56
Playing with Rust

Playing with Rust

DRAFT DRAFT DRAFT

I finally got back to my idea of a small Rust project. Here I'll list my findings so far.

You'll notice that I talk about FFI a lot. Maybe that's just me but I see the following ways I can start playing with an emerging language:

  1. Build some webby stuff. A small service for my existing webapp in a different language would be nice. However, HTTP is still not great in Rust (it's getting there!), so I decided not to do it for now.
@listochkin
listochkin / keybase.md
Created January 24, 2017 01:13
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am listochkin on github.
  • I am listochkin (https://keybase.io/listochkin) on keybase.
  • I have a public key ASAsRsmUuljyfl6KLsdW5GxpyCXmMzFSUcFrnCxk3ukIhAo

To claim this, I am signing this object:

@listochkin
listochkin / README.md
Last active March 11, 2017 06:41
How Node Resolves Dependencies

How Node Resolves Dependencies

Read more about node_modules and how you can use them in official node/iojs docs:

If the module identifier passed to require() is not a native module, and does not begin with '/', '../', or './', then io.js starts at the parent directory of the current module, and adds /node_modules, and attempts to load the module from that location.

If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.

Here I show you how you can easily build a hierarchy of modules inside your project and use nested node_modules directories to manage dependencies within your application. This is a pretty good solution that doesn't require you to change NODE_PATH, use many git repositories or setting up a private registry.

@listochkin
listochkin / gist:1200393
Created September 7, 2011 12:02
Algorithm for Area of a closed polygon.

Re: Algorithm for Area of a closed polygon.

To: Ted Hill <thill@tomotherapy.com>
Subject: Re: Algorithm for Area of a closed polygon.
From: "Demian M. Nave" <dnave@psc.edu>
Date: Wed, 12 Nov 2003 21:23:16 -0500 (EST)
Cc: <compgeom-discuss@research.bell-labs.com>
In-reply-to: <1E2E66102E75104D8C740340EBCD98671BC279@tomoex.tomotherapy.com>

References: <1E2E66102E75104D8C740340EBCD98671BC279@tomoex.tomotherapy.com>