Skip to content

Instantly share code, notes, and snippets.

View ktknest's full-sized avatar

KATO Kenichi ktknest

  • CyberAgent, Inc.
  • Tokyo, Japan
View GitHub Profile
/**
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@yomotsu
yomotsu / gist:7e2ec401c1520d880308
Last active February 24, 2022 14:16
BEMが失敗しているパターンとその問題点

思いついたら足していく

名前にとらわれすぎ

BAD1

「コンポーネントのエレメントのエレメントのエレメントの...」として定義している

  <div class="v1-news">
@mfyz
mfyz / resize_preview.html
Created April 8, 2014 21:49
HTML5 FileReader + canvas resizer to resize & preview before upload an image using jquery.
<!DOCTYPE html>
<html>
<head>
<title>Angular HTML5 Preview, Crop And Upload</title>
<style>
body {
padding: 50px;
font: 16px Helvetica;
}
@pocotan001
pocotan001 / globals.snippets.js
Last active April 29, 2023 15:03
Finding improper JavaScript globals.
// globals.js
// https://gist.github.com/pocotan001/6305714
// Finding improper JavaScript globals
(function() {
var prop, cleanWindow,
globals = new function globals() {},
body = document.body,
iframe = document.createElement('iframe'),
ignore = {
@studiomohawk
studiomohawk / making-of-cssradar-at-twitter.md
Last active April 26, 2016 16:21
Making of CSS Radar @ Twitter

Making of CSS Radar @ Twitter

CSS Radar @ Twitterの(短い)歴史

ほとんど更新されないのがコンセプトのCSS Radarの代わりにTwitterを使って海外のフロントエンドな情報を共有しはじめたのがいつのことだったかはあんまり定かではない。 当の本人は結構やってるんじゃないかと思ったりもするが、きっとそんなことはないのだろう。

紹介する記事のトピックや量は時間の経過と共に変化してきたが、変わらないことが1つだけ。
それはどの記事も必ず読んでから紹介すること。
今年に入って、Gistを使って5件ずつ紹介しはじめたのは、Twitterでは説明しきれていない部分が多すぎると思ったからだ。

@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@juno
juno / github-flow.ja.md
Last active April 9, 2021 02:20
GitHub Flow (Japanese translation) Latest version is here: https://gist.github.com/Gab-km/3705015

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップでgit-flowについてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name