Skip to content

Instantly share code, notes, and snippets.

@developit
developit / split-point.js
Last active December 5, 2017 16:35
A couple of variants for preact split points
import { h, Component } from 'preact';
/**
* <SplitPoint load={require('bundle?lazy!./foo')} fallbackContent={(
* <div class="loading" />
* )} />
*/
class SplitPoint extends Component {
componentWillMount() {
let cb = this.linkState('child'),
@ooade
ooade / tax_rate.py
Created September 3, 2016 15:50
Tax Rate Challenge
def calculate_tax(names):
try:
new_dict = {}
for name in names:
a = [0, 1000, 10000, 20200, 30750, 50000]
b = [1000, 10000, 20200, 30750, 50000, 100000]
p = [0, .1, .15, .2, .25, .3]
amount = names[name]
tax = 0
i = 0
@zxbodya
zxbodya / render-react-with-rxjs.md
Last active November 1, 2021 08:49
React with RxJS, reactive way :)

Observable React elements with RxJS

Note: if you want to skip history behind this, and just looking for final result see: rx-react-container

When I just started using RxJS with React, I was subscribing to observables in componentDidMount and disposing subscriptions at componentWillUnmount.

But, soon I realised that it is not fun to do all that subscriptions(that are just updating property in component state) manually, and written mixin for this...

Later I have rewritten it as "high order component" and added possibility to pass also obsarvers that will receive events from component.

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@rxaviers
rxaviers / gist:7360908
Last active May 31, 2024 14:32
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@elijahmanor
elijahmanor / jokes.md
Last active February 18, 2024 05:02
Front-End Web Dev Jokes

Front-End Web Dev Jokes

Authored by Elijah Manor

  • q. How do you comfort a JavaScript bug? a. You console it

  • When a JavaScript date has gone bad, "Don't call me, I'll callback you. I promise!"

  • Dev1 saw a strange JavaScript function & asked, "What is this?". Dev2 responded, "I don't know. I would've called you, but I was in a bind"

/** @jsx React.DOM */
var MyRootComponent = React.createClass({
getInitialState: function() {
return {perMinute: '-', perDay: '-'};
},
componentDidMount: function() {
var socket = io.connect(this.props.url);
socket.on('business.clickout', this.setState.bind(this));
},
render: function() {