Skip to content

Instantly share code, notes, and snippets.

View nodirt's full-sized avatar

Nodir Turakulov nodirt

View GitHub Profile
@nodirt
nodirt / main.go
Last active January 25, 2018 02:48
Reading from both stdout and stderr in one func
package main
import (
"bytes"
"fmt"
"io"
"os/exec"
)
// RunAndListen intercepts cmd.Stdout and cmd.Stderr and runs cmd.
@nodirt
nodirt / a.md
Last active August 31, 2015 18:30

Markdown style guide

Much of what makes Markdown great is the ability to write plain text, and get great formatted output as a result. To keep the slate clean for the next author, your Markdown should be simple and consistent with the whole corpus wherever possible.

We seek to balance three goals:

  1. Source text is readable and portable.

Does GitHub Markdown support trailing slash?

It does
not

___________.__ __ ._.
\__ ___/| |__ _____ ____ | | __ ___.__. ____ __ __| |
| | | | \\__ \ / \| |/ / < | |/ _ \| | \ |
| | | Y \/ __ \| | \ < \___ ( <_> ) | /\|
|____| |___| (____ /___| /__|_ \ / ____|\____/|____/ __
\/ \/ \/ \/ \/ \/

Chrome Infra Configuration service (luci-config)

  • Owner: nodir@
  • Prod instance: luci-config.appspot.com

[TOC]

Overview

  • Stores a registry of projects (clients) and chrome infra services
Uncaught SyntaxError: Unexpected token )
(index):28 GET http://githut.info/web/js/vendors/d3/d3.min.js (anonymous function) @ (index):28
main.js:1 Uncaught ReferenceError: d3 is not defined
import java.util.*;
public class BellmanFord
{
public static long dist[];
public static long prev[];
public static LinkedList<DirectedEdge> edgesList = new LinkedList<DirectedEdge>();
public static class DirectedEdge{
protected int v;
protected int w; // edge
@nodirt
nodirt / gist:6662833
Last active December 23, 2015 16:29
Problem: given a long sequence of numbers, find those *two* that have odd number of occurrences. Limitations: * the sequence can be traversed only once * 10 KB of memory
/*
Problem: given a long sequence of numbers, find those *two* that have odd number of occurrences.
Limitations:
* the sequence can be traversed only once
* 10 KB of memory
*/
using System;
using System.Collections.Generic;
package code;
public class MinWordRegion {
public static class Result {
/** zero-based */
public int start;
/** zero-based */
public int end;
public int length() {
@nodirt
nodirt / sort012.py
Last active December 17, 2015 08:19
Sorting an array consisting of 0, 1 and 2
import random
def sort012(array):
n = len(array)
p0 = 0 # end of the '0' block
p2 = n - 1 # beginning of the '2' block
i = 0
while i <= p2:
x = array[i]