Skip to content

Instantly share code, notes, and snippets.

Кажется, основное реакт-кунфу — в умении проводить границы между компонентами. Тогда переделывать становится гораздо проще.

Первый слой разделения: это контейнеры и презентационные компоненты (Дэн Абрамов про это написал достаточно подробно). Контейнеры готовят данные, а презентационные компоненты их отображают. С помощью разных контейнеров мы подгружаем/готовим разные наборы данных, а с помощью одного презентационного — отображаем.


Второй слой: все блоки, которые собираются итератором.

Плохо:

@pachadotdev
pachadotdev / r_python_homebrew.sh
Last active October 9, 2022 06:41
Install R and Python via Homebrew
# See http://pacha.hk/2017-07-12_r_and_python_via_homebrew.html
# XCode CLT
xcode-select --install
# Update Homebrew and add formulae
brew update
# Check for broken dependencies and/or outdated packages
brew doctor
@bbeaudreault
bbeaudreault / HBaseMapReduceUtils.java
Last active November 8, 2017 06:28
Control # of mappers per RegionServer
package org.apache.hadoop.hbase.mapreduce;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.mapreduce.Job;
@ejdyksen
ejdyksen / patch-edid.md
Last active July 18, 2024 14:37
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@dallasmarlow
dallasmarlow / hbase_compactor.rb
Created January 6, 2014 22:31
simple hbase compactor tool
#!/usr/bin/env jruby
require 'socket'
require 'optparse'
import org.apache.hadoop.hbase.HBaseConfiguration
import org.apache.hadoop.hbase.client.HBaseAdmin
import org.apache.hadoop.hbase.zookeeper.ZKUtil
import org.apache.hadoop.hbase.util.Bytes
options = {}
@debasishg
debasishg / gist:8172796
Last active July 5, 2024 11:53
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@obscurerichard
obscurerichard / README.md
Created September 17, 2012 22:35
Simulates a low bandwidth, high-latency network connection

slow

This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.

slow 3G                   # Slow network on default eth0 down to 3G wireless speeds
slow reset                # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet  with a high latency
slow dsl -b 1mbps         # Simulate DSL with a slower speed than the default

slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@SaveTheRbtz
SaveTheRbtz / aggregate_filestat.py
Created April 16, 2012 10:46
Linux per-file IO statistics
#!/usr/bin/env python
import logging as log
from fileinput import input
from collections import namedtuple, defaultdict
from pprint import pprint
if __debug__:
log_level = log.DEBUG
else: