Skip to content

Instantly share code, notes, and snippets.

View alexeypegov's full-sized avatar
🖖

Alexey Pegov alexeypegov

🖖
View GitHub Profile
BEGIN MESSAGE.
0mXN3EAcfT5U9Fe GrbfP3WBCGlo1eT 2bXnkb59eHGco6b QXN7SwofdKVXePJ
yvk7WEvQH7J7avu jQer9yGlOOJTCKq 6Xr2MZHgg6tMd0T uqTha0axH2WqLw0
n9LiwTSniN6RaJL K6DEFuA4Ac9bZdv 2gxWNnhBKKsDwlp lzjZaQuPTufUpEL
5lLjUZ88Gio5Fkj bIbefot81GFgvEf bg4hF0aLMzWSiL.
END MESSAGE.
@alexeypegov
alexeypegov / Preferences.sublime-settings
Created May 28, 2018 08:50
Sublime Text configuration
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@alexeypegov
alexeypegov / extract-tdumps.clj
Last active May 13, 2018 16:33
Extruct java thread dumps from a log file
#!/usr/bin/env inlein
'{:dependencies [[org.clojure/clojure "1.9.0"]]}
(require '[clojure.string :as s]
'[clojure.java.io :as io])
(def filename (first *command-line-args*))
(when-not filename
@alexeypegov
alexeypegov / ini.clj
Created January 7, 2018 15:17
Simple INI-file parser
(ns ini.core
(:use [clojure.string :only [index-of last-index-of trim split-lines]]
[slingshot.slingshot :only [throw+]]))
(defn- section?
"Whatever the given string is a section or not"
[s]
(and
(= (first s) \[)
(= (last s) \])))

Keybase proof

I hereby claim:

  • I am alexeypegov on github.
  • I am alexeypegov (https://keybase.io/alexeypegov) on keybase.
  • I have a public key ASAcmSzYgSkiqw5hl9Ds9WDHcs6x8uwswa2oAtEZ6sTB-go

To claim this, I am signing this object:

@alexeypegov
alexeypegov / fillTextVsDrawImagePerformance.js
Last active January 24, 2022 18:38
Compare performance of fillText() vs drawImage() for HTML5 Canvas
// jshint esnext:true
// noprotect
const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
function init(el, width, height) {
const _el = el ? el : document.createElement('canvas');
if (!el) {
$('body').append(_el);
}
@alexeypegov
alexeypegov / SheetView.swift
Created November 15, 2014 11:47
SheetView
//
// SheetView.swift
// wrkts
//
// Created by Alexey Pegov on 28.10.14.
// Copyright (c) 2014 alexeypegov. All rights reserved.
//
import UIKit
@alexeypegov
alexeypegov / innershadow.js
Created February 13, 2014 20:45
HTML5 Canvas Shadow (Opposite Winding solution)
/* <canvas id="c" width="200" height="200"></canvas> */
function retina(canvas, context) {
var ratio = window.devicePixelRatio || 1,
width = canvas.width,
height = canvas.height;
if (ratio > 1) {
canvas.width = width * ratio;
canvas.height = height * ratio;
canvas.style.width = width + "px";
@alexeypegov
alexeypegov / proto.msg
Last active April 27, 2022 23:36
ProtoBuffers debug with CURL. ProtoBuffers should be installed first: "yum install protobuf" or "brew install protobuf".
key:"string value"
int_key:22
@alexeypegov
alexeypegov / git-rbr
Created October 16, 2013 16:47
Quickly create Git remote branch. Place it somewhere in the PATH and call like this: "git rbr branch_name"
#!/bin/sh
if [ -n "$1" ]; then
git checkout -b $1
git push --set-upstream origin $1
else
echo "Usage: git rbr branch-name"
fi