Skip to content

Instantly share code, notes, and snippets.

View nodirt's full-sized avatar

Nodir Turakulov nodirt

View GitHub Profile
@nodirt
nodirt / gist:1469584
Created December 12, 2011 23:12
Find lost, unreachable commits
# retrieves commit relative date and message
humanify() {
while read hash; do
# echo to trim the new line
echo $( git log -n 1 ..$hash --format='%ci : %h : %s%n%b' )
done
}
# show the commits!
git fsck --unreachable | grep -oP '(?<=commit )\w+' | humanify | sort
@nodirt
nodirt / FakeMap.js
Created December 12, 2011 23:29
Indexers in JavaScript
function FakeMap() {
var data = [];
function indexOf(key) {
var i;
for (i = 0; i < data.length; i++) {
if (data[i].key === key) return i;
}
return -1;
}
@nodirt
nodirt / classArg.py
Created January 23, 2012 04:59
Constructor as an argument
def mymap(fn, iterable):
for x in iterable:
yield fn(x)
class A(object):
def __init__(self, x):
self.x = x
@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]
package code;
public class MinWordRegion {
public static class Result {
/** zero-based */
public int start;
/** zero-based */
public int end;
public int length() {
@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;
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
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

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
___________.__ __ ._.
\__ ___/| |__ _____ ____ | | __ ___.__. ____ __ __| |
| | | | \\__ \ / \| |/ / < | |/ _ \| | \ |
| | | Y \/ __ \| | \ < \___ ( <_> ) | /\|
|____| |___| (____ /___| /__|_ \ / ____|\____/|____/ __
\/ \/ \/ \/ \/ \/