Skip to content

Instantly share code, notes, and snippets.

View rndD's full-sized avatar
🌽

Alexey Kalmakov rndD

🌽
  • Clickhouse Inc
  • Berlin
View GitHub Profile
@corpix
corpix / convert.coffee
Created June 7, 2012 15:49
Конвертирование видео по расширению параллельно
#!/bin/env coffee
require 'colors'
childProcess = require 'child_process'
spawn = childProcess.spawn
program = require 'commander'
os = require 'os'
fs = require 'fs'
async = require 'async'
# Cached variables
@rtt
rtt / tinder-api-documentation.md
Last active June 21, 2024 04:19
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

#!/usr/bin/env python
"""Measure relative performance of "count overlapping substrings" functions.
http://hashcode.ru/questions/404985/python-%D1%85%D0%B8%D1%82%D1%80%D0%BE%D0%B5-%D0%B2%D1%85%D0%BE%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BF%D0%BE%D0%B4%D1%81%D1%82%D1%80%D0%BE%D0%BA%D0%B8-%D0%B2-%D1%81%D1%82%D1%80%D0%BE%D0%BA%D1%83
"""
import re
def count_overlapping_substrings(haystack, needle):
count = 0
i = -1
@tvlooy
tvlooy / unit.sh
Last active February 4, 2024 04:20
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@alexclifford
alexclifford / s3_set_object_public.sh
Created July 24, 2015 01:59
Make S3 object public and private via s3cmd command line
s3cmd setacl s3://bucket/path/to/file --acl-public
s3cmd info s3://bucket/path/to/file
s3cmd setacl s3://bucket/path/to/file --acl-private
@rclai
rclai / meteor-wrapAsync.js
Last active January 30, 2023 15:20
Flexible example of Meteor.wrapAsync
// Thanks @trusktr
var requestSync = Meteor.wrapAsync(function(url, callback) {
request(url, function(error, response, body) {
callback(error, {response: response, body: body})
})
});
var result = requestSync("http://google.com");
console.log(result.response, result.body);
@rndD
rndD / npm
Created July 9, 2016 12:19
Npm inject для кеширования папки node_modules
#!/usr/bin/env bash
# Фейковый npm
# Нужен для кэширования папки node_modules
# Кэш находится в папке ~/.cache/npm-inject/[sha1 хэш файла package.json]/node_modules
#
# В PATH надо добавить путь папки с фейковым npm, таким образом при выполнении команды `npm install`
# bash вызовет фейковый npm c параметром `install`.
# Фейк проверяет наличие папки [sha1 хэш файла package.json] в кэше.
# Если она в кэше, создаем на неё симлинк node_modules
@rndD
rndD / .gitconfig
Last active November 13, 2023 11:40
git config for 2022-2023
[user]
name = Alexey Kalmakov
email = st00nsa@gmail.com
[core]
mergeoptions = --no-ff
pager = less -r
[alias]
vlog = log --pretty='%h (%an) %s' --graph
st = status
co = checkout
@MrMeison
MrMeison / CBR.gs
Created January 8, 2020 11:46
Формула для Google Sheets для получения котировок валюты на заданную дату
var CBR_ENTRYPOINT = "https://www.cbr.ru/scripts/XML_daily.asp";
/**
* Получаем курс ЦБ на дату
*
* @param {string} currency - код валюты
* @param {Date} date - день
* @return {Number}
* @customfunction
*/
@MrMeison
MrMeison / inflation.gs
Created January 8, 2020 11:52
Формула для Google Sheets для получения инфляции в стране за произвольный период
var ENTRYPOINT = "https://www.statbureau.org/calculate-inflation-rate-json";
/**
* Получаем инфлацию за произвольный период
*
* @param {string} country - страна (belarus, brazil, canada, european-union, eurozone, france, germany, greece, india, japan, kazakhstan, mexico, russia, spain, turkey, ukraine, united-kingdom, united-states)
* @param {Date} start - первый месяц, включительно
* @param {Date} end - последний месяц, включительно
* @return Получаем инфляцию за произвольный период
* @customfunction