Skip to content

Instantly share code, notes, and snippets.

View monzou's full-sized avatar

Takuro Monji monzou

  • Tokyo
View GitHub Profile
@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}/>;
}
}
@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)
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
@kjaquier
kjaquier / BitSet.java
Last active August 29, 2015 14:01
Enum based and memory efficient flag set.
public class BitSet<T extends Enum<?>> {
private byte[] bytes;
@SafeVarargs
public BitSet(T... elements) {
bytes = new byte[elements.length / 8 + 1];
}
private int bitMask(int ordinal) {

いかにして我々はフロントエンドに秩序をもたらそうとしてきたか

@mizchi / Quipper

最初に

  • 人間性捧げすぎて資料作るの忘れてました

@aseemk
aseemk / coffeescript-updates.md
Last active December 2, 2017 20:22
CoffeeScript upcoming changes.

CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.

Parentheses-free chaining

jashkenas/coffeescript#3263

Years of being wished for, finally granted!

@nobuoka
nobuoka / JavaAptPlugin.groovy
Last active September 28, 2017 09:23
Java Annotation Processing Task for Gradle
// buildSrc/src/main/groovy/JavaAptPlugin.groovy
class JavaAPT extends DefaultTask {
private File _destinationDir
def getDestinationDir(dir) { _destinationDir }
void setDestinationDir(dir) {
_destinationDir = dir
outputs.dir _destinationDir
}
@p-j
p-j / Gruntfile.js
Created August 26, 2013 12:37
Gruntfile.js inspired by Yeoman's webapp generated Gruntfiles, with BlessCSS and Assemble, Htmlmin configured to run smoothly with Usemin and Coffee/Mocha stuff commented out.
// Generated on 2013-07-30 using generator-webapp 0.2.6
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@mochiz
mochiz / gist:4736183
Last active April 16, 2023 03:56
rbenvとruby-buildでRuby環境を最新に保つ

rbenvとruby-buildでRuby環境を最新に保つ

更新日:2014/11/19

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master