Skip to content

Instantly share code, notes, and snippets.

🍃
learning type

KaFai bruteforcecat

🍃
learning type
Block or report user

Report or block bruteforcecat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Dr-Nikson
Dr-Nikson / README.md
Last active Mar 13, 2018
Auth example (react + redux + react-router)
View README.md
@aitoroses
aitoroses / AnimateMixinFactory.js
Last active Jan 23, 2018
Dynamics.js and React
View AnimateMixinFactory.js
export function AnimateMixinFactory(stateName) {
var animateMixin = {
getInitialState() {
return {
[stateName]: {}
}
}
};
@acdlite
acdlite / flux.js
Last active May 31, 2019
A Redux-like Flux implementation in <75 lines of code
View flux.js
/**
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
*/
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
@danawoodman
danawoodman / 1-react-websockets-reflux.md
Last active May 23, 2018
Using WebSockets with Reflux and React
View 1-react-websockets-reflux.md

WebSockets + Reflux + React

Using WebSockets, React and Reflux together can be a beautiful thing, but the intial setup can be a bit of a pain. The below examples attempt to offer one (arguably enjoyable) way to use these tools together.

Overview

This trifect works well if you think of things like so:

  1. Reflux Store: The store fetches, updates and persists data. A store can be a list of items or a single item. Most of the times you reach for this.state in react should instead live within stores. Stores can listen to other stores as well as to events being fired.
  2. Reflux Actions: Actions are triggered by components when the component wants to change the state of the store. A store listens to actions and can listen to more than one set of actions.
@sebmarkbage
sebmarkbage / Enhance.js
Last active Oct 15, 2019
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@staltz
staltz / introrx.md
Last active Oct 17, 2019
The introduction to Reactive Programming you've been missing
View introrx.md
@tadast
tadast / ssl_puma.sh
Last active Oct 16, 2019 — forked from trcarden/gist:3295935
localhost SSL with puma
View ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Oct 14, 2019
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@trcarden
trcarden / gist:3295935
Created Aug 8, 2012
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
View gist:3295935
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@jboner
jboner / latency.txt
Last active Oct 17, 2019
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
You can’t perform that action at this time.