Skip to content

Instantly share code, notes, and snippets.

View hexode's full-sized avatar

Alexander Verkhoglyad hexode

  • Toloka
  • Belgrade
  • 09:38 (UTC +02:00)
View GitHub Profile
{
"runs": [
{
"timings": [
{
"title": "First Contentful Paint",
"id": "firstContentfulPaint",
"timing": 3452,
"color": "green"
},
{
"runs": [
{
"timings": [
{
"title": "First Contentful Paint",
"id": "firstContentfulPaint",
"timing": 3895,
"color": "green"
},
[35.097,
35.2311015625,
38.42019921875,
306.71209375,
149520.576,
130320.56,
142680.112,
149640.544,
130440.456,
142440.32,
@hexode
hexode / diner.tsv
Created November 29, 2019 14:53
diner.tsv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
INPUT:in OUTPUT:result GOLDEN:result HINT:text ASSIGNMENT:link ASSIGNMENT:assignment_id ASSIGNMENT:worker_id ASSIGNMENT:status ASSIGNMENT:started ASSIGNMENT:submitted
1 "{""totalCorrect"":32,""percentComplete"":1,""lastPercentEvent"":0.9999999999999999,""guessHistory"":{""0"":{""correct"":true,""incorrectCount"":2},""1"":{""correct"":true,""incorrectCount"":0},""2"":{""correct"":true,""incorrectCount"":1},""3"":{""correct"":true,""incorrectCount"":1},""4"":{""correct"":true,""incorrectCount"":0},""5"":{""correct"":true,""incorrectCount"":0},""6"":{""correct"":true,""incorrectCount"":0},""7"":{""correct"":true,""incorrectCount"":5},""8"":{""correct"":true,""incorrectCount"":0},""9"":{""correct"":true,""incorrectCount"":0},""10"":{""correct"":true,""incorrectCount"":0},""11"":{""correct"":true,""incorrectCount"":0},""12"":{""correct"":true,""incorrectCount"":0},""13"":{""correct"":true,""incorrectCount"":0},""14"":{""correct"":true,""incorrectCount"":1},""15"":{""correct"":true,""incorrectCount"":3},""16"":{""c
@hexode
hexode / diner.tsv
Created November 29, 2019 14:52
diner.tsv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
INPUT:in OUTPUT:result GOLDEN:result HINT:text ASSIGNMENT:link ASSIGNMENT:assignment_id ASSIGNMENT:worker_id ASSIGNMENT:status ASSIGNMENT:started ASSIGNMENT:submitted
1 "{""totalCorrect"":32,""percentComplete"":1,""lastPercentEvent"":0.9999999999999999,""guessHistory"":{""0"":{""correct"":true,""incorrectCount"":2},""1"":{""correct"":true,""incorrectCount"":0},""2"":{""correct"":true,""incorrectCount"":1},""3"":{""correct"":true,""incorrectCount"":1},""4"":{""correct"":true,""incorrectCount"":0},""5"":{""correct"":true,""incorrectCount"":0},""6"":{""correct"":true,""incorrectCount"":0},""7"":{""correct"":true,""incorrectCount"":5},""8"":{""correct"":true,""incorrectCount"":0},""9"":{""correct"":true,""incorrectCount"":0},""10"":{""correct"":true,""incorrectCount"":0},""11"":{""correct"":true,""incorrectCount"":0},""12"":{""correct"":true,""incorrectCount"":0},""13"":{""correct"":true,""incorrectCount"":0},""14"":{""correct"":true,""incorrectCount"":1},""15"":{""correct"":true,""incorrectCount"":3},""16"":{""c
class SettingsService {
private _instance;
get() {
return this._instance
}
set(settings) {
this._instance = settings;
}
@hexode
hexode / gist:6e026efc19afc2be9f4c9fb08ad6077b
Created November 18, 2016 17:15
Handling error in promises
new Promise.reject(new CustomError())
.catch(handleError(CustomError, () => {
}))
.catch(handleError(AnotherError, () => {
}))
.catch(handleError(Error, () => {
}));
@hexode
hexode / on-jsx.markdown
Created October 31, 2016 08:22 — forked from chantastic/on-jsx.markdown
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

var browserify = require('browserify');
var watchify = require('watchify');
var reactify = require('reactify');
var gulp = require('gulp');
var handleErrors = require('../util/handleErrors');
var source = require('vinyl-source-stream');
function scripts(watch) {
var bundler, rebundle;
@hexode
hexode / logging.txt
Last active August 4, 2016 07:32
Primitive logging
const fs = require('fs');
const logStream = fs.createWriteStream(`${__dirname}/log.txt`, { flags: 'w' });
const log = ((ix = 0) => msg => logStream.write(`${++ix}: ${msg}\n`))();