Skip to content

Instantly share code, notes, and snippets.

View chernomyrdin's full-sized avatar

Andrey Chernomyrdin chernomyrdin

  • Saint-Petersburg
View GitHub Profile
@chernomyrdin
chernomyrdin / test_hash.pl
Created November 14, 2012 11:17
test for non empty hash
#!/usr/bin/perl -w --
use strict;
use Benchmark;
my %hash;
for (1..1e6) {
my $key = join($_, "*" x (10*rand), "*" x (10*rand));
@chernomyrdin
chernomyrdin / Dummy.hx
Created January 20, 2012 10:44
Simple Haxe file
package ;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import flash.Lib;
class Dummy extends MovieClip {
private static var _ready:Bool = false;
@chernomyrdin
chernomyrdin / bloger-float.js
Created December 16, 2011 00:53
Bloger Float button
function share42 (f,u,t,m1,m2) {
if (!u) {
u = location.href;
}
u = encodeURIComponent(u);
if (!t) {
t = document.title;
}
t = encodeURIComponent(t);
@chernomyrdin
chernomyrdin / form.html
Created December 2, 2011 11:08
js form
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body {
background-color: white;
}
form .field .red {
display: none;
@chernomyrdin
chernomyrdin / comments.html
Created November 30, 2011 07:32
Применение стилей для нескольких классов одного элемента
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Применение стилей для нескольких классов одного элемента</title>
<style type="text/css">
body {
background-color: white;
}
p {
@chernomyrdin
chernomyrdin / pqsaff.js
Created October 27, 2011 12:23
Parse query_string and fill form
function pqsaff () {
this.vars = (window.location.search.length > 1) ?
window.location.search.substring(1).split("&") :
[];
}
pqsaff.prototype = {
param: function (s) {
var p = s.split("=");
this.name = p.shift();
@chernomyrdin
chernomyrdin / read_bmp.pl
Created October 14, 2011 10:04
Read BMP file
#!/usr/bin/perl -w --
use strict;
use warnings;
use IO::File;
my %header;
my %bitmap;
my @palette;
my $fh = IO::File->new("_.bmp");
@chernomyrdin
chernomyrdin / mysql.pl
Created October 7, 2011 10:36
Sample perl/mysql code
#!/usr/bin/perl -w --
use warnings;
use strict;
use utf8;
package DoMysql;
use DBI;