Skip to content

Instantly share code, notes, and snippets.

View lemming's full-sized avatar
:shipit:

Aleksei Cherevatov lemming

:shipit:
  • 3dEYE
  • Saint Petersburg
View GitHub Profile
Player
error -> Error
toDVR -> DVR
toLive -> Live
toArchive -> Archive
Archive
DVR
@lemming
lemming / index.js
Created March 3, 2018 09:26
async flow with generators example
function* gen() {
const previous = yield new Promise(resolve => setTimeout(() => resolve(1), 1000));
yield new Promise(resolve => setTimeout(() => resolve(previous + 1), 1000));
}
async function flow(gen) {
const iterator = gen();
let result;
atom-fuzzy-grep@0.15.0
atom-move-line@0.3.3
atom-ternjs@0.17.0
autocomplete-modules@1.6.7
autocomplete-paths@1.0.5
code-peek@1.4.14
date@1.1.1
docblockr@0.9.1
double-tag@0.4.0
editorconfig@2.2.0
@lemming
lemming / spinner.sh
Created December 10, 2016 05:31
spinner.sh
#!/bin/sh
spinner()
{
local pid=$1
local delay=0.1
local spinners=(⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏)
local spinners_count=${#spinners[@]}
local spinstr='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local infotext=$2
@lemming
lemming / index.html
Created July 31, 2016 11:21
Rx draggable example
<div id="draggable-block" style="border: 2px solid black; padding: 20px; display:inline-block">Drag me</div>
function pluralize(n, forms) {
return forms[n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2];
}
@lemming
lemming / 0_reuse_code.js
Created May 28, 2014 19:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env ruby
KEYS_BY_ACTION = { next: :Right, prev: :Left, toggle: :space }
action = (ARGV.first || 'toggle').to_sym
action = :toggle unless KEYS_BY_ACTION.has_key? action
unless (window = `xdotool search "Google Play"`[0..-2]).empty?
`xdotool keydown --window #{window} #{KEYS_BY_ACTION[action]}`
else
'use strict';
angular.module('saSchedulerApp.directives')
.directive('pickadate', [function () {
return {
require: '?ngModel',
link: function (scope, elm, attrs, ngModel) {
var pickadateOptions = { format: 'dd.mm.yyyy' };
if (!ngModel) {
@lemming
lemming / Fx 5.0 extensions list
Created June 25, 2011 13:24
Firefox extensions list for my personal profile
- Adblock Plus
- Add Bookmark Here ²
- Add to Search Bar (Отключено, Несовместимо)
- CoolPreviews
- Element Hiding Helper для Adblock Plus (Отключено, Несовместимо)
- Extension List Dumper
- FireGestures
- GMarks (Отключено, Несовместимо)
- Greasemonkey
- Locationbar² (Отключено, Несовместимо)