Skip to content

Instantly share code, notes, and snippets.

View narqo's full-sized avatar
🌕
Berlin, +10°

Vladimir Varankin narqo

🌕
Berlin, +10°
View GitHub Profile
package main
import (
"github.com/mailru/easyjson"
)
type FlatJSONResponse struct {
Tmpl string
Vars easyjson.RawMessage
}
@narqo
narqo / README.md
Last active October 29, 2016 14:05
Count the number of "Go" word in the list of URLs.
  • Take a list of URLs from the os.Stdin.
  • For every URL in the list start a goroutines.
  • Do not run more than k=5 goroutines.
  • Do not run more than len(URLs) goroutines (e.g. if k=1000 and len(urls)=10).
@narqo
narqo / golang-reports-rename.go
Created September 15, 2016 13:17
A silly Go program to rename reports of golang show
// A program to rename reports from github.com/LK4D4/report
// See https://github.com/LK4D4/report/issues/2
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
import Popup from 'popup';
class Tooltip extends Component {
render() {
return (
<Popup visible={this.props.visible} anchor={this.props.anchor} onRequestHide={this.onPopupRequestHide}>
<div onMouseEnter={this.onPopupMouseEnter} onMouseLeave={this.onPopupMouseLeave}>
{this.props.children}
</div>
</Popup>
@narqo
narqo / 1week.md
Last active August 29, 2016 15:37
Functional Programming (FP) Scala, https://www.coursera.org/learn/progfun1/

Week 1 (Functions & Evaluation)

Paradigms:

  • imperative programming
  • functional programming
  • logical

no place for mutation in high-level concepts

: ${DOCKER:=docker}
# fix git detached clone
git repack -a -d && rm -f .git/objects/info/alternates
# update the changelog inside a container
$DOCKER run --rm -v $PWD:/tmp/build -w /tmp/build \
-e "EDITOR=/bin/true" \
-e "DEBEMAIL=$DEBEMAIL" -e "DEBFULLNAME=$DEBFULLNAME" -e "DEB_VENDOR=debian" \
registry.ape.yandex.net/vertis/buildbox-buildpkg:1.trusty \
@narqo
narqo / gist:3109465f3003374c92776c64cf141f76
Created June 3, 2016 23:25
how docker's libnetwork works
docker start ...
docker/daemon/container_linux.go
container.Start()
container.initializeNetworking()
container.AllocateNetwork()
n := container.daemon.netController.NetworkByName()
ep := n.CreateEndpoint()
d := n.driver
class Component {
}
const hoverable = supperCls => class extends supperCls {
constructor(...args) {
super(...args);
this.state = {
...this.state,
hovered: false,
import React from 'react';
import { findDOMNode } from 'react-dom';
import bem from 'b_';
const b = bem.with('button');
const KEY_SPACE = ' ';
const KEY_ENTER = 'Enter';
class Button extends React.Component {
# docker version
docker version
Client:
Version: 1.10.2
API version: 1.22
Go version: go1.5.3
Git commit: c3959b1
Built: Mon Feb 22 21:37:01 2016
OS/Arch: linux/amd64