Skip to content

Instantly share code, notes, and snippets.

я котик пур-пур mvasilkov

Block or report user

Report or block mvasilkov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mvasilkov / somoto_task.html
Last active Nov 26, 2019
Вороны клюют твою задачу, Джузеппе!
View somoto_task.html
<!doctype html>
<html lang="en">
<meta charset="utf8">
<title>Crows peck at your crops, Giuseppe!</title>
#thing {
height: 100px;
width: 100px;
mvasilkov / auth_form.js
Created Jun 25, 2019 modal form with wrappedComponentRef
View auth_form.js
import React from 'react'
import { Form, Input } from 'antd'
import lang from '../app/lang'
export default Form.create({ name: 'auth' })(
class AuthForm extends React.Component {
render() {
const { getFieldDecorator } = this.props.form
mvasilkov /
Created Mar 15, 2013
Recursively remove trailing whitespace from all files in the working directory.
find . -not \( -name .git -prune -o -name .hg -prune -o -name .svn -prune \) \
-type f -exec sed -i '' 's/[[:blank:]]*$//' '{}' \;
View music_formula_collection.txt
Collection of oneliner music formulas. Version 2011-10-18
I've tried to collect all the formulas in the related threads etc.
(excluding those that clearly sound like random first experiments or total
crap; when several variants are available, i've chosen the shortest one)
If you think I've missed something that should be here, please let me know.
====== 1ST ITERATION ======
import Image, ExifTags
try:, fileName))
for orientation in ExifTags.TAGS.keys():
if ExifTags.TAGS[orientation]=='Orientation': break
if exif[orientation] == 3:
image=image.rotate(180, expand=True)
mvasilkov /
Created Feb 9, 2012
Return first non-repeating (unique) symbol in the string. With tests and timeit.
#!/usr/bin/env python
import re
from timeit import timeit
import unittest
UNIQ_RE = re.compile(r'(.)(?=.*?\1)')
'test': 'e',
'plperl': 'e',
mvasilkov /
Created Jan 27, 2012
RestfulView from libanimuchan
from django.shortcuts import render
class RestfulView(object):
allowed_methods = ["GET", "POST"]
def __call__(self, request, *args, **kwargs):
if request.method not in self.allowed_methods or not hasattr(self, request.method):
return self.method_not_allowed(request)
return getattr(self, request.method)(request, *args, **kwargs)
View map.txt
# _ = empty
# X = solid ground
# S = sand
mvasilkov / remove_lines
Created Nov 18, 2013
Remove empty lines at the end of file.
View remove_lines
last_non_blank_ln=$(grep -En ^. $1 |tail -n 1 |sed 's/:.*//')
head -n $((last_non_blank_ln + 1)) $1 > _xxx
mv _xxx $1
You can’t perform that action at this time.