Skip to content

Instantly share code, notes, and snippets.

@evenchange4
evenchange4 / gist:e04ad27f329272238b556a491139b812
Last active September 2, 2019 04:19 — forked from simonw/gist:92481
Compile nginx standalone without root access
# Compile nginx standalone without root access
mkdir ~/installed
mkdir ~/installed/nginx
mkdir ~/src
cd ~/src
# PCRE dependency - we'll compile against this statically
wget http://kent.dl.sourceforge.net/sourceforge/pcre/pcre-8.42.tar.gz
tar -xzvf pcre-8.42.tar.gz
@evenchange4
evenchange4 / multiple_ssh_setting.md
Created March 29, 2018 02:47 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@evenchange4
evenchange4 / circle.yml
Created August 9, 2017 05:46
Auto deployment to now.sh in CI
machine:
node:
version: 7
deployment:
staging:
branch: master
owner: my-company
commands:
- ./deploy-staging.sh
production:
@evenchange4
evenchange4 / !react-enzyme-render-methods.md
Created February 20, 2017 06:22 — forked from richardscarrott/!react-enzyme-render-methods.md
react-enzyme - `shallow` vs `mount` vs `render` lifecycle methods

An exploration of the different render methods available in react-enzyme.

Child Component
onChangeHandler (val, name) {
// Is there anyway that I can share the handler among different Select while keeping in mind that which Select(corresponding to entry) is called ?
this.props.onChange(val, name)
}
render () {
<Select name="select1" value={this.props.data["select1"]} options=this.props.options onChange={value => this.onChangeHandler(value, 'select1')} />
<Select name="select2" value={this.props.data["select2"]} options=this.props.options onChange={value => this.onChangeHandler(value, 'select2')} />
<Select name="select3" value={this.props.data["select3"]} options=this.props.options onChange={value => this.onChangeHandler(value, 'select3')} />
<Select name="select4" value={this.props.data["select4"]} options=this.props.options onChange={value => this.onChangeHandler(value, 'select4')} />
@evenchange4
evenchange4 / gist:2d02827528853d78a7f3
Created February 24, 2016 08:55 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@evenchange4
evenchange4 / AnotherAntiPattern.js
Created February 5, 2016 03:32 — forked from wuct/AnotherAntiPattern.js
Nesting children is also an anti-pure-render pattern.
// Consider <Button /> is a pure render component
const AntiPureComponet = () => <div>
Call me maybe?
<Button><IconPhone /> Call</Button>
</div>
// When <AntiPureComponet /> renders, it creates a new child (by calling React.createElement) and pass to <Button />.
// This behavior forces <Button /> to re-render everytime.
@evenchange4
evenchange4 / zsh.md
Last active August 29, 2015 14:16 — forked from tsabat/zsh.md

Movies Recommendation:

Music Recommendation: