Skip to content

Instantly share code, notes, and snippets.

View icholy's full-sized avatar
💥
breaking things

Ilia Choly icholy

💥
breaking things
View GitHub Profile
@icholy
icholy / keybase.md
Created September 22, 2014 16:41
keybase.md

Keybase proof

I hereby claim:

  • I am icholy on github.
  • I am icholy (https://keybase.io/icholy) on keybase.
  • I have a public key whose fingerprint is 3AA2 92C8 B490 087E 81CB D4F1 6111 83D4 99DB 8217

To claim this, I am signing this object:

I prefer this

var distance = metersToNauticalMiles(
  utils.getDistance(
    utils.toPoint(coordinates.get(0)),
    utils.toPoint(coordinates.get(1))
  )
);

Here's a very simple controller and service. The service can be turned on and off with a checkbox.

<body ng-app="App">
  <div ng-controller="MyController">
    <input type="checkbox" ng-model="enabled">
  </div>
</body>
#!/usr/bin/env python
# Source: http://www.codingninja.co.uk/best-programmers-quotes/
quotes = [
{
"text": "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.",
"author": "C.A.R. Hoare, The 1980 ACM Turing Award Lecture"
}, {
"text": "The computing scientist's main challenge is not to get confused by the complexities of his own making.",
// Use Case:
//
// Say you have a bunch of decoupled components which access the same set of databases.
// Since database/sql does connection pooling it makes sense for the components to share instances of *sql.DB
// This package lets you do that with minimal code changes.
package dbmanager
import (
"database/sql"
"time"

Keybase proof

I hereby claim:

  • I am icholy on github.
  • I am icholy (https://keybase.io/icholy) on keybase.
  • I have a public key whose fingerprint is C620 B860 AF4D 339A 9D40 F764 ADF7 55F3 74A0 0CCB

To claim this, I am signing this object:

@icholy
icholy / goi.md
Last active August 31, 2017 03:17

Interfaces

Let's imagine a very simple table

CREATE TABLE people {
  id bigserial,
  name character varying
}

There is a 1-to-1 relationship between ids and items.

with item_ids as (
	      select 1 as id
	union select 2
	union select 3
	union select 4
	union select 5
	union select 6
@icholy
icholy / go_js.md
Last active August 29, 2015 14:09
Go style javascript

Js style (one of many):

// constructor
var Foo = function () {};

// private
Foo.prototype._poo = function () {};

// public
/**
* 1. Go to this page: https://my.playstation.com/logged-in/trophies/public-trophies/ (using google chrome)
* 2. Right click on the page and select "inspect element"
* 3. Go to the "console" tab.
* 4. Change the names below with the ones you want to test
* 5. Copy/Paste the following script in the console and hit "enter".
*/
(function () {