Skip to content

Instantly share code, notes, and snippets.

View dreikanter's full-sized avatar

Alex Musayev dreikanter

View GitHub Profile
@dreikanter
dreikanter / how-to-upwork.md
Last active April 1, 2017 13:29
How to UpWork

How to UpWork

  1. Write everything. Regardless UpWork or current amount of projects. Tasks, plans, meeting notes, requirements, questions, whatever you have. No need to keep this stuff in your head.

    Specific tool does not matter. I'm using plain text files in Dropbox for work notes, email drafts, and any other texts. And A4 squared paper notebooks. I like paper because it is fast and dead simple (and because I like handwriting). But this is a matter of personal preference. Just try different options and see what will work.

    And try using some task tracker if you don't do this yet. Even for your personal notes and planning. It really helps to keep things organized, when each task has a timestamp, there is full-text search, and you may see the list of what was done today, yesterday, or this week.

I like trello.com (super-simple way to organize lists), checkvist.com (minimalistic general-purpose outliner). Some of my friends like Todoist, a nice organizer with mobile client. There are gazillion of a

@dreikanter
dreikanter / delete-other-search-engines-from-chrome.md
Last active March 21, 2017 15:04
How to delete all "Other search engines" from Chrome

Motivation:

The list of "Other search engines" in Chrome settings could become bloated and unmanageable. Slow UI reaction makes it really hard to search through this list, or drop unnecessary items.

Solution:

  1. Go to chrome://settings/searchEngines
  2. Open dev tools (Cmd+Shift+I or Ctrl-Shift+I)
  3. Run this (execution may take a minute):
@dreikanter
dreikanter / find_words.pseudocode.js
Last active March 8, 2017 19:38
Find words on a single row of a querty keyboard
text = "source text banana banana banana ..."
// Transcoding map to convert keybords characters sequence to natural numbers: { 'q' => 0, 'w' => 1, ... }
characterCodesMap = "qwertyuiopasdfghjklzxcvbnm".mapWithIndex((character, index) => { return [character, index] }).toHash
// Character code ranges for keyboard rows
row1 = 0..9
row2 = 10..18
row3 = 19..25 // Actually this one will never be used
@dreikanter
dreikanter / expose_monosnap_url.user.js
Last active August 25, 2016 10:12
A Tampermonkey user script for Chrome, that displays direct screenshot URL on Monosnap pages to make it easier to copy.
// ==UserScript==
// @name Monosnap Direct URL Expose
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Display direct screenshot URL on Monosnap pages to make it easier to copy.
// @author Alex Musayev
// @include https://monosnap.com/file/*
// ==/UserScript==
(function() {
@dreikanter
dreikanter / encrypt_openssl.md
Last active April 20, 2024 13:45 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@dreikanter
dreikanter / sample_exif.rb
Created June 9, 2016 14:42
iOS 9.3 Sample EXIF
#<Exif::Data:0x007ffeca954c20
@aperture_value="2.53 EV (f/2.4)",
@brightness_value="5.91 EV (205.64 cd/m^2)",
@color_space=0,
@components_configuration="Y Cb Cr -",
@compression=0,
@contents=
{0=>
{:make=>"Apple",
:model=>"iPhone 5",
@dreikanter
dreikanter / likes.rb
Last active January 28, 2016 11:20
Likes collapse logic
USER_NAME_LENGTH_RANGE = 3..("хорошо хоть, что хуй цел".length)
LIKES_AMOUNT = 100
LENGTH_LIMIT = 80
visible = []
(1..LIKES_AMOUNT).each do |index|
next_like = (index.to_s * rand(USER_NAME_LENGTH_RANGE))[0, USER_NAME_LENGTH_RANGE.max]
visible.unshift next_like
joined_likes = -> { visible.join(', ') }
@dreikanter
dreikanter / enum1.rb
Last active December 13, 2015 18:15
More meaningful ActiveRecord::Enum
class Enum
def self.value(key, value = nil)
@enum ||= {}
@enum[key] = value || @enum.size
define_singleton_method(key) { @enum[key] }
end
def self.enum
@enum
end
@dreikanter
dreikanter / ngram.rb
Last active December 5, 2015 13:07
N-grams counter
require 'pp'
WORDS = %w(correct horse battery staple)
LENGTH = 100
SOURCE = (0..LENGTH).map { WORDS.sample }
puts "Source: #{SOURCE.join(', ')}"
###