Skip to content

Instantly share code, notes, and snippets.

View monzou's full-sized avatar

Takuro Monji monzou

  • Tokyo
View GitHub Profile
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
@kozo002
kozo002 / jquery.event-mapping.coffee
Last active August 29, 2015 14:07
Backbone.js like event mapping
jQuery.eventMapping = (object) ->
jQuery.each object.events, (event_and_selector, handler_name) ->
[event, selector_with_elem_name] = event_and_selector.split(' ')
[selector, elem_name] = selector_with_elem_name.split('|')
object.$el.on(event, selector, jQuery.proxy(object[handler_name], object))
if elem_name? then object[elem_name] = object.$el.find(selector)
@tejacques
tejacques / HOCBaseRender.tsx
Last active May 2, 2022 13:05
React Higher Order Components in TypeScript
import * as React from 'react';
import { Component } from 'react';
export default function HOCBaseRender<Props, State, ComponentState>(
Comp: new() => Component<Props & State, ComponentState>) {
return class HOCBase extends Component<Props, State> {
render() {
return <Comp {...this.props} {...this.state}/>;
}
}