Skip to content

Instantly share code, notes, and snippets.

View iexa's full-sized avatar
💭
yorkie = lambda woof, bark: {bark: woof}

CsabaK iexa

💭
yorkie = lambda woof, bark: {bark: woof}
View GitHub Profile
@iexa
iexa / python-with-tcl.rb
Last active July 20, 2021 05:35
MacOS homebrew python 3.8.6 with tcl-tk (properly)
class Python < Formula
desc "Interpreted, interactive, object-oriented programming language"
homepage "https://www.python.org/"
url "https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz"
sha256 "a9e0b79d27aa056eb9cce8d63a427b5f9bab1465dee3f942dcfdb25a82f4ab8a"
head "https://github.com/python/cpython.git"
license "Python-2.0"
revision 1
bottle do
@iexa
iexa / mass-unpack.py
Last active March 30, 2021 01:47
unpack scene release files (double-packed .rar files) with python
"""
unpacks rar files that are double-packed
-usually scene-release files are packed this way
"""
__author__ = 'iexa'
from pathlib import Path
import rarfile as rf
from time import time
# import zipfile as zf
@iexa
iexa / dl.js
Last active April 25, 2020 16:26
mass files downloader using node.js + json file. {also for es6 concepts}
// dl.js script, dl.json is {'folder_name1': [url1, url2, url3, ...], 'folder_name2': [...], ...}
//
// 1st "major" mod - now uses async "threads" to download several files at once. m.o. is not the
// best way to do it; but it saves some time and does not overwhelm servers
//
// examples for data scraping :D
// a = document.querySelectorAll('ul#list>li>a.folder')
// JSON.stringify(Array.prototype.map.call(a, i => decodeURI(i.href.split('/').reverse()[1])))
//
// ... and files from inside folders:
@iexa
iexa / Architecture.md
Created March 26, 2020 11:49 — forked from evancz/Architecture.md
Ideas and guidelines for architecting larger applications in Elm to be modular and extensible

Architecture in Elm

This document is a collection of concepts and strategies to make large Elm projects modular and extensible.

We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp. You will probably merge a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:

  1. There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo
@iexa
iexa / System Design.md
Created May 23, 2020 05:09 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@iexa
iexa / hbqc.py
Last active January 22, 2024 14:37
Python script to create a handbrake encoding queue for a tree of files using a built-in json template
#!/usr/bin/env python3
"""
Handbrake (json) Queue Creator
last updated: 2021/oct/9 iexa
changelog:
- 21/oct/9: open hb.json file in utf8 encoding to be sure
- 21/jul/15: added rotation check
- 21/jun/23: added ffmpeg automatic resolution sniffing
"""
@iexa
iexa / data_science_links.md
Last active June 27, 2021 07:18
data science links
@iexa
iexa / functional_cart_test.js
Last active December 2, 2021 07:24
functional example cart with reduce in js
user = {
name: 'Joe',
active: true,
purchases: [],
cart: []
}
const compose = (f, g) => { return (...args) => f(g(...args)) } // in reduce new acc/f will be a fn
// all functions are coiled up from last to first -
@iexa
iexa / mergesorted.js
Last active December 2, 2021 07:27
merge sorted arrays js
// const {log} = console
// merge sorted
a = [0, 4, 6, 7];
b = [1, 2, 3, 4, 8];
function mergeSorted(x1, x2) {
const out = [];
const [l1, l2] = [x1.length, x2.length];
let [i1, i2] = [0, 0];