Skip to content

Instantly share code, notes, and snippets.

View jeromelachaud's full-sized avatar
🏡
Working from home

Jerome Lachaud jeromelachaud

🏡
Working from home
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 (
@ifamily
ifamily / wp-config.php
Last active January 8, 2024 05:06
A universal WordPress wp-config.php which works on local development to staging and production server environments.
<?php
/*
One wp-config for local development to staging to production.
*/
// Define Environments
$environments = array(
@edds
edds / README.md
Created September 4, 2011 08:21
Socket.IO example to stream tweets on a topic

A simple example to create a websocket server and stream tweets about a pre-defined subject to the page.

Installation

$ npm install socket.io, twitter

Run

$ node ./app.js