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>
#!/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² (Отключено, Несовместимо)
#!/bin/bash
RESPONSE="`$HOME/bin/post-picasa "$1" 2>&1`"
if [ $? = 0 ]; then
zenity --entry --entry-text="$RESPONSE" --title="Изображение $1 загружено" --text="Нажмите «OK», чтобы скопировать адрес и закрыть это окно" | xclip -selection clipboard
else
echo $RESPONSE | zenity --text-info --title="Произошла ошибка"
fi
function youtube-play() {
if [ $# -eq 1 ]; then
YOUTUBE_LINK=$1
else
YOUTUBE_LINK=`xclip -o -selection "clipboard" | grep -oE 'http[^&]*' | head -n1`
fi
YOUTUBE_COOKIES=$HOME/.youtube.cookies
if [ ! -e $YOUTUBE_COOKIES ]; then
curl -c $YOUTUBE_COOKIES http://www.youtube.com > /dev/null 2>&1
fi