Skip to content

Instantly share code, notes, and snippets.

View beautyfree's full-sized avatar
😼

Alexey Elizarov beautyfree

😼
View GitHub Profile
var text = "#вакансия #Москва #офис #angular #developer #JavaScript
Город и адрес офиса: Москва, м. Шаболовская
Формат работы: офис
Занятость: полная
Название компании: Spice IT (КА)
Зарплатная вилка: от 150 000 до 180 000 net.
Ищу JS разработчика на разработку коммерческого SPA-приложения и его компонентов, основной фреймворк Angular 4.
Обязанности:

Keybase proof

I hereby claim:

  • I am beautyfree on github.
  • I am devall (https://keybase.io/devall) on keybase.
  • I have a public key whose fingerprint is F845 2E9A AFE4 6AA6 65D7 603B 6960 EBED A201 FCE8

To claim this, I am signing this object:

const fs = require('fs')
const path = require('path')
const { createCanvas, loadImage } = require('canvas')
const canvas = createCanvas(640, 1136)
const ctx = canvas.getContext('2d')
//ctx.fillStyle = 'rgba(235,133,190,1)'
ctx.fillStyle = 'rgba(242,228,231,1)'
ctx.fillRect(0, 0, 640, 1136)
@beautyfree
beautyfree / api.js
Created January 30, 2018 12:31
call api saga queue
import { take, takeEvery, put, all, fork, call } from 'redux-saga/effects'
import { channel, delay, select } from 'redux-saga'
import { callApi, CALL_API } from 'redux/services'
const REQUESTS_COUNT = 3
const REQUESTS_DELAY = 1000
class RequestsBuffer {
constructor() { this.queue = [] }
isEmpty = () => !this.queue.length
@beautyfree
beautyfree / api.js
Created January 30, 2018 00:40
Rate limit for api requests from https://github.com/axios/axios/issues/230
function promiseDebounce(fn, delay, count) {
var working = 0, queue = []
function work() {
if ((queue.length === 0) || (working === count)) return
working++
new Promise(function(resolve, reject){
setTimeout(function(){
working--
work()
@beautyfree
beautyfree / golang.go
Last active September 21, 2017 12:00
Repeatable periodical task job with timeout stop
func schedule(what func(), timeout time.Duration) {
ch := make(chan bool)
go func() {
what()
ch <- true
}()
select {
case <-time.After(timeout):

Keybase proof

I hereby claim:

  • I am beautyfree on github.
  • I am devall (https://keybase.io/devall) on keybase.
  • I have a public key whose fingerprint is 6D6E 20F9 24BA 9D9F 497D 0001 C724 25E3 2900 BC2B

To claim this, I am signing this object:

@beautyfree
beautyfree / fb.js
Last active December 9, 2015 20:02
<html>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
@beautyfree
beautyfree / extract.py
Created November 17, 2015 00:59 — forked from kalloc/extract.py
#!/usr/bin/env python3
import nltk
import re
import sys
import json
import string
from nltk.corpus import stopwords
import pymorphy2
@beautyfree
beautyfree / seostat.py
Created November 16, 2015 22:56 — forked from otykhonruk/seostat.py
Simple SEO-related text metrics.
import re
import sys
from collections import Counter
from pymorphy2 import MorphAnalyzer
morph = MorphAnalyzer()
def words(text):
return re.findall('[а-яА-Яa-zA-Z-]+', text.lower())