- copy the file
commit-msg
to.git/hooks/commit-msg
- make sure your delete the sample file
.git/hooks/commit-msg.sample
- Make commit msg executable.
chmod +x .git/hooks/commit-msg
- Edit
commit-msg
to better fit your development branch, commit regex and error message - Profit $$
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.ByteString.Lazy as L | |
import Data.Word (Word8) | |
data Stats = Stats | |
{ total :: Int | |
, count :: Int | |
} | |
initStats :: Stats | |
initStats = Stats 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { push } from 'react-router-redux'; | |
import { takeLatest, call, put } from 'redux-saga/effects'; | |
import config from '../../../config/client'; | |
import { REQUEST_POST_LIST } from '../actions'; | |
import updatePostList from '../actions/updatePostList'; | |
import fetchPostList from './utils/fetchPostList'; | |
import trackPageViewWithGoogleAnalytics from '../actions/trackPageViewWithGoogleAnalytics'; | |
import trackPageViewWithIvw from '../actions/trackPageViewWithIvw'; | |
export function *requestPostList({ threadId, page }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This makes two connections, one to a tcp server, one to an http server (both in server.js) | |
// It fires off a bunch of connections and times the response | |
// Both send strings. | |
const net = require(`net`); | |
const http = require(`http`); | |
function parseIncomingMessage(res) { | |
return new Promise((resolve) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
elem.clientLeft
,elem.clientTop
,elem.clientWidth
,elem.clientHeight
elem.getClientRects()
,elem.getBoundingClientRect()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html class="no-scroll"> | |
<head> | |
<style> | |
.no-scroll, | |
body.loading-app { | |
overflow: hidden; | |
} | |
body.loading-app #splash-screen { | |
opacity: 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010 | |
* http://benalman.com/ | |
* | |
* Original Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
* | |
* Made awesome by Rick Waldron | |
* |