Skip to content

Instantly share code, notes, and snippets.

View mervick's full-sized avatar

Andrey Izman mervick

View GitHub Profile
@mervick
mervick / dl-cloud-mail-ru.sh
Created July 14, 2018 16:14 — forked from cronfy/dl-cloud-mail-ru.sh
Download file from cloud.mail.ru from linux console with bash script
#!/usr/bin/env bash
# 2018-06-18 updated: mail.ru changed internals
# 2017-09-22 original idea: https://novall.net/itnews/bash-skript-dlya-skachivaniya-fajlov-s-mail-ru-cherez-konsol-linux.html
URL="$1"
DST_FILE="$2"
[ -z "$DST_FILE" ] && {
echo "Syntax: `basename $0` <url> <dst_file>" >&2
@mervick
mervick / generatePassword.js
Created May 30, 2018 08:55
JS: Strong random password generator
function generatePassword (length) {
var password = '', character;
while (length > password.length) {
if (password.indexOf(character = String.fromCharCode(Math.floor(Math.random() * 94) + 33), Math.floor(password.length / 94) * 94) < 0) {
password += character;
}
}
return password;
}
@mervick
mervick / feedly_api.md
Created April 24, 2018 21:58 — forked from d3m3vilurr/feedly_api.md
Unofficial Feedly API Document

IDs

  • user_id - user/:uid
  • feed_id - feed/:feed_uri
  • category_id - :user_id/category/:category (special category: global.all, global.uncategorized)
  • tag_id - :user_id/tag/:tag (special tag: global.saved)

APIs

http://cloud.feedly.com/:version/:api

@mervick
mervick / rest_quick_reference.md
Created March 14, 2018 14:17 — forked from odan/rest_quick_reference.md
REST, RESTful API Quick Reference

REST, RESTful API Quick Reference

A good API is not just easy to use but also hard to misuse.

Ressources

  • Version your API
    • Path: /v1/users
    • Subdomain: api.v1.example.com/users
@mervick
mervick / add.js
Created February 11, 2018 09:17 — forked from simenbrekken/add.js
Backbone.js form submission
define([
'backbone',
'underscore',
'project/views/form'
], function(Backbone, _, ProjectFormView) {
var View = Backbone.View.extend({
events: {
'submit form': 'submit'
},
@mervick
mervick / stream_to_youtube.sh
Created February 9, 2018 09:57 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@mervick
mervick / aes_example.cs
Created February 8, 2018 04:02 — forked from mark-adams/aes_example.cs
AES String Encryption (CBC) Example Code for C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace aes_example
{
using System;
@mervick
mervick / AES.go
Created February 6, 2018 17:23 — forked from shautzin/AES.go
AES/CBC/PKCS5Padding implementation by Golang
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"fmt"
)
func main() {
@mervick
mervick / AesCrypt.py
Created February 6, 2018 04:51 — forked from pfote/AesCrypt.py
AES256 with PKCS5 padding
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import random
import hashlib
import os
class AesCrypt256:
<?php
/* Code from http://tantek.pbworks.com/NewBase60
License: http://creativecommons.org/licenses/by-sa/3.0/
Author: Tantek Çelik <http://tantek.com>
*/
function strcat($a, $b) {
return $a.$b;
}