Skip to content

Instantly share code, notes, and snippets.

View George1's full-sized avatar

Yuri Sakhno George1

View GitHub Profile
@George1
George1 / gist:3793925
Created September 27, 2012 13:15 — forked from michalbcz/gist:2757630
groovy - when you're missing collectWithIndex method...
Collection.metaClass.collectWithIndex = { yield ->
def collected = []
delegate.eachWithIndex { listItem, index ->
collected << yield(listItem, index)
}
return collected
}
/*
@George1
George1 / cs215_ps4-6_actor_centrality.py
Created July 26, 2012 12:39
This is my Pyhton's solution for the problem Actor Centrality from CS215 Algorithms class on Udacity
import csv
def make_link(G, node1, node2):
if node1 not in G:
G[node1] = set()
G[node1].add(node2)
if node2 not in G:
G[node2] = set()
G[node2].add(node1)
return G
@George1
George1 / common_greasemonkey_utils.js
Created May 3, 2010 19:49
Contains utility functions commonly-used in my Greasemonkey scripts
/*
* Commonly used utility functions for Greasemonkey scripts
*
* Copyright © 2010, Yuri Sakhno
*/
// version 1.1
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(elt, from) {
var len = this.length >>> 0;
@George1
George1 / vkontakte_images.js
Created May 3, 2010 19:44
Contains image data for Another Widescreen VKontakte script (http://userscripts.org/scripts/show/75785)
/*
* Images for Another Widescreen VKontakte script
*
* Copyright © 2010, Yuri Sakhno
*/
// version 1.0
var emptyImageData="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
var backgroundImageData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAApCAMAAABjq9sOAAAABGdBTUEAAK/INwWK6QAAABl"+
"0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAABvUExURUdznSRTfxdIdERvlzRijDpnkUt1ny9dhilYg013oCZVgBVGckZynEt2nz9rlB1P"+
"ejFeiSFQfEl0nBtLd0NwmTJgijZjjhZHczllkBxOeRlJdUh0nkVxmzxpk0BtlStahUJumCJSfShXghVFck55oZ5vss4AAABhSURBVHjavMrHAYIAAMDAA"+
@George1
George1 / grails.bat
Created February 24, 2010 21:24
Automatically selects version of Grails to run based either on context, environment variable, or command line argument.
@ECHO OFF
REM
REM Automatic Grails Version Selector v1.0
REM
REM Description:
REM Automatically selects version of Grails to run based either
REM on context, environment variable, or command line argument.
REM
REM Copyright © 2010, Componentix (http://www.componentix.com/)