Skip to content

Instantly share code, notes, and snippets.

@ababup1192
ababup1192 / elm-hello-world.md
Last active June 29, 2020 08:31
Elmの開発環境を整えて、HelloWorldをするまで

ElmのHello Worldができるまで (2018 10/25)

nodeのインストール

  • 可能であれば、nvm, nodebrew等を使ってnodeをインストールする。

以下が、現時点(2018/9/3)の安定版のバージョン。

$ node -v
@yuheiy
yuheiy / spacing-rules.md
Last active October 28, 2021 15:47
ウェブデザインの余白に規則性を持たせるためのパターン

ウェブデザインの余白に規則性を持たせるためのパターン

フォントサイズベース

$spacing: 1rem;

body {
  margin: ($spacing * 4) $spacing;
}
@gaearon
gaearon / connect.js
Last active April 11, 2024 06:46
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@fand
fand / flux_history.md
Last active October 19, 2016 04:26
Flux戦争の歴史

Flux戦争の歴史メモ

Fluxxor by binarymuse

  • 2014/05/12 first commit
    • F8での "Flux" の登場からわずか4日
  • 素朴な実装
  • mixinベースの機能
    • 〜React v0.12という感じ

Reflux by spoike

var Col = require('react-bootstrap/lib/Col')
var PageHeader = require('react-bootstrap/lib/PageHeader')
var React = require('react')
var Row = require('react-bootstrap/lib/Row')
var {connect} = require('react-redux')
var {reduxForm} = require('redux-form')
var DateInput = require('./DateInput')
var FormField = require('./FormField')
var LoadingButton = require('./LoadingButton')
@gonzaloserrano
gonzaloserrano / log.go
Created August 18, 2015 17:56
logrus wrapper
package log
import (
"fmt"
"github.com/Sirupsen/logrus"
"runtime"
"strings"
)
var logger = logrus.New()
@fukajun
fukajun / gist:edea3c4f36e37bf36e8b
Last active February 19, 2017 14:28
pecoでgit logから指定したコミットのハッシュを取るコマンド
git log --graph --pretty=format:'%d %an: %s %ar %h' | peco | awk -F ' ' '{ print $NF }'
@youcune
youcune / fadein.html
Created August 24, 2014 12:23
CSS3 のみで display: none からフェードインさせる
<!DOCTYPE html>
<html>
<head>
<meta charst='utf-8'>
<title>TEST</title>
<script src="//code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<style>
.box {
background: #000000;
display: none;
@sebmarkbage
sebmarkbage / JSXSpreadAttributes.md
Last active August 13, 2020 15:18
JSX Spread Attributes

JSX Spread Attributes

If you know all the properties that you want to place on a component a head of time, it is easy to use JSX:

  var component = <Component foo={x} bar={y} />;

Mutating Props is Bad, mkay

@joakimbeng
joakimbeng / router.html
Last active March 15, 2024 06:18
A really simple Javascript router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Building a router</title>
<script>
// Put John's template engine code here...
(function () {
// A hash to store our routes: