Skip to content

Instantly share code, notes, and snippets.

View egoist's full-sized avatar
🙏
Please support my open-source projects!

EGOIST egoist

🙏
Please support my open-source projects!
View GitHub Profile
@rgrove
rgrove / README.md
Created February 8, 2016 19:01
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the
@nathggns
nathggns / stroke.scss
Created June 24, 2012 17:40
Text Stroke SCSS Mixin (SASS)
@mixin stroke($width, $color) {
$shadow: 0 0 0 transparent;
$i: 0;
@while ($i < $width) {
$i: $i + 1;
$j: 0;
@while ($j < 2) {
$j: $j + 1;
#! /usr/bin/env bash
# Usage: git-io URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
URL="$1"
CODE="$2"
@egoist
egoist / pgsql.md
Last active May 14, 2016 14:37
PostgreSQL 简明指南

安装

# ubuntu
$ sudo apt-get install postgresql

控制台

upstream php {
server unix:/var/run/php5-fpm.sock;
}
server {
# enforce NO www
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
@egoist
egoist / css-layout-no-flexbox.md
Last active February 8, 2016 06:04
CSS 布局(非 flexbox 篇)

单栏

<div class="container">
  css is awesome!  
</div>
.container {
@egoist
egoist / jquery to xxx.md
Last active January 7, 2016 08:08
Compile jQuery to XXX component

form jQuery:

<div class="bingo">
  <button>Say hi!</button>
</div>

<script>
  $('button').on('click', function () {
 console.log('hi')