Skip to content

Instantly share code, notes, and snippets.

View h4's full-sized avatar
💭
I may be slow to respond.

Mikhail Baranov h4

💭
I may be slow to respond.
View GitHub Profile
@h4
h4 / rename.py
Last active April 15, 2019 16:08
GIT rename bunch of files using python
#!/usr/bin/env python3
import subprocess
import time
from os import walk, path, chdir
import re
regex = re.compile(r'([0-9a-f]+)_(\w+)\.py')
date_re = re.compile(r'(\d+)-(\d+)-(\d+) (\d+):(\d+)')
chdir('/Users/h4/Projects/Arrival/components-catalogue/alembic/versions')
for root, dirs, files in walk('/Users/h4/Projects/Arrival/components-catalogue/alembic/versions'):
@h4
h4 / aESPtemplate.cpp
Created April 7, 2019 07:13
ESP 8266 Template
// arduinoESP8266 wifi & eeprom setting template
// ----------------------------------- libs -----------------------------------
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>
#include <EEPROM.h>
@jlongster
jlongster / immutable-libraries.md
Last active May 6, 2024 12:37
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

System

  1. Set up iCloud Keychain
  2. Remove icons and hide Dock
  3. Default address in iMessage
  4. Install Updates
  5. Add Ru Input Sources
  6. Set up Shortcuts
  7. Add text shortcuts Text
@bobbygrace
bobbygrace / trello-css-guide.md
Last active April 22, 2024 10:15
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@alexeyraspopov
alexeyraspopov / links.md
Created December 6, 2014 18:15
Полный список ссылок к докладу о функциональном программировании на WSD 2014
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing
@mesuutt
mesuutt / django-template-filters.py
Last active October 1, 2020 06:39
Useful django template tags and filters
# coding: utf-8
import json
from django import template
from django.utils.dateparse import parse_datetime
from django.utils.html import mark_safe
register = template.Library()
git rev-list --all --objects | \
sed -n $(git rev-list --objects --all | \
cut -f1 -d' ' | \
git cat-file --batch-check | \
grep blob | \
sort -n -k 3 | \
tail -n40 | \
while read hash type size; do
echo -n "-e s/$hash/$size/p ";
done) | \