Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am kurochenko on github.
  • I am kurochenko (https://keybase.io/kurochenko) on keybase.
  • I have a public key whose fingerprint is A1AE 7F9F C452 EAE3 FAA7 58BE 1714 B059 52CE AA39

To claim this, I am signing this object:

/**
* Check if object can be treated as array
*/
function isArrayLike(obj) {
return isArray(obj) || isString(obj) || isJqLite(obj) || hasLengthAttribute(obj) || hasItemFunction(obj)
}
function isJqLite(obj) {
return jqLite && obj instanceof jqLite
}

Keybase proof

I hereby claim:

  • I am kurochenko on github.
  • I am kurochenko (https://keybase.io/kurochenko) on keybase.
  • I have a public key whose fingerprint is 5A26 D964 6F38 651E E94A 208F 2641 DBA1 E073 4483

To claim this, I am signing this object:

@kurochenko
kurochenko / plot_csv.sh
Last active August 29, 2015 14:11
bash script to plot development of Voronoi diagram nodes in protein molecule when searching for pockets
#!/bin/sh
#
# Expected input: "csv" folder with subfolders (PDB names of structures) with *.csf files in format:
#
# probe_size;node_order;is_on_surface
#
# Will plot graph of probe radius. Probe is approaching protein molecule from "infinite" distance. Impult is plotted when
# probe enters protein structure.
#
@kurochenko
kurochenko / gist:9933422
Created April 2, 2014 12:49
sublime config
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"caret_style": "solid",
"color_scheme": "Packages/Perv - Color Scheme/Perv Orange Moonlight.tmTheme",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
@kurochenko
kurochenko / gist:5203739
Created March 20, 2013 10:40
Correct equals for JPA Entity
/**
* Entities can't use getClass method to compare equality of entities.
* This is because when Lazy loading is used, there is included subclass of
* entity to the lazy loaded field instead of required entity. And equals method
* would fail. Therefore we need to use instance of which is not symmetric.
*
* testInstanceOf can be overriden in sublasses if we don't want to hav compatible with actual class
*/
@Override
public boolean equals(Object o) {
@kurochenko
kurochenko / cleaner.sh
Created March 3, 2012 14:32
Script recursively removes all files from specified destination except those specified in configuration
#!/bin/bash
tmp_file="/tmp/tmp.del"
counter=0
if [ -e $tmp_file ]; then
rm $tmp_file
fi
[ -d "$1" ] && find "$1" -type f | grep -Evi "\.(ogg|mp3|flac|wav|wma|sfw|wmv|avi|3gp|mpg|mkv|mpeg|m4a|sfv|amv)$" >> $tmp_file