Skip to content

Instantly share code, notes, and snippets.

View madfriend's full-sized avatar

Alex Chuchunkov madfriend

  • Yandex, OpenCorpora
  • St. Petersburg, Russia
View GitHub Profile
let div = document.createElement('div');
div.style.height = '100px';
div.style.width = '100px';
div.style.background = 'red';
div.style.display = 'inline-block';
document.body.appendChild(div);
let div = document.createElement('div');
div.style.height = '100px';
div.style.width = '100px';
div.style.background = 'red';
div.style.display = 'inline-block';
document.body.appendChild(div);
let frameCounter = 0;
function countFrames () {
frameCounter++;
requestAnimationFrame(countFrames);
}
requestAnimationFrame(countFrames);
function* animate (from, to, numFrames) {
#! coding: utf-8
# sklearn = библиотека scikit-learn (http://scikit-learn.org)
# Установить можно, например, так:
# сначала поставить дистрибутив Anaconda (https://www.continuum.io/downloads#_windows)
# а потом в терминале "conda install sklearn".
# Нам из sklearn нужно не так много
from sklearn.linear_model import LogisticRegression
# в sklearn есть удобная функция для создания
# отчетов по качеству классификации (Precision, Recall, F1)
from sklearn.metrics import classification_report
@madfriend
madfriend / test.tag
Last active November 26, 2015 10:51
<my-parent-tag>
<div>
this is parent tag
<script type="riot/tag" src="https://rawgit.com/madfriend/51a535e989b710429334/raw/18753e624291e350e3f230aaece6a93be3785299/test2.tag"></script>
<my-tag>this should be replaced by my-tag contents</my-tag>
</div>
</my-parent-tag>
<my-tag>
hello
</my-tag>
@madfriend
madfriend / snip.js
Created September 10, 2015 21:11
my jquery snippets
$.fn.mapGetter = function(prop) {
return $(this).map(function(i, e) {
return $(e).attr(prop);
}).get();
};
$.fn.filterByAttr = function(attr, val) {
return $(this).filter(function(i, e) {
return $(e).attr(attr) == val;
});
@madfriend
madfriend / be.html
Last active August 29, 2015 14:18
be with m decoupled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BE with M decoupled</title>
</head>
<body>
<div class="container">
<div class="new-label-form is-hidden">
<h2 class="new-label-form--title">
@madfriend
madfriend / gost-r-madfriend.csl
Created March 29, 2015 21:14
ГОСТ Р 7.0.1-2003 + 7.0.5-2008 для Zotero (мопед не мой, но что-то правил для себя)
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
<info>
<title>Russian GOST R 7.0.1-2003 + 7.0.5-2008 numeric (madfriend)</title>
<id>http://www.zotero.org/styles/gost-r-7-0-5-2008-num-appear</id>
<link href="http://www.zotero.org/styles/gost-r-7-0-5-2008-num-appear" rel="self"/>
<link href="https://dl.dropboxusercontent.com/u/95616327/Permanent_files/GOST-for-Zotero-Documentation.zip" rel="documentation"/>
<author>
<name>Roman Raspopov</name>
<email>romanraspopov@gmail.com</email>
start: program;
program: outer_block*;
outer_block: (outer_line NEWLINE)*
outer_line?;
@outer_line: initialization
| assignment
';';
assignment: name '='