Skip to content

Instantly share code, notes, and snippets.

View nachiket-p's full-sized avatar

Nachiket Patel nachiket-p

View GitHub Profile
@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 (
@nnnnathann
nnnnathann / gist:3491640
Created August 27, 2012 19:37
Reverse HTTP Proxy (Apache + nodejs)
We couldn’t find that file to show.
@abersager
abersager / index.html
Created March 29, 2012 22:36
Using cookies and nginx web server configuration to conditionally serve high resolution images
<!doctype html>
<!--
Using cookies and nginx web server configuration to conditionally serve
high resolution images to <img> tags
-->
<html>
<head>
<!-- set device-pixel-ratio cookie using JavaScript -->
<script type="text/javascript" charset="utf-8">