Skip to content

Instantly share code, notes, and snippets.

@yannickcr
yannickcr / Resources.md
Last active September 15, 2016 09:31
React.js Conf 2015 - From the Internet
var pureRender = (Component) => {
Object.assign(Component.prototype, {
shouldComponentUpdate (nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
});
};
module.exports = pureRender;
package main
import (
"fmt"
"github.com/moovweb/gokogiri"
"io/ioutil"
"net/http"
"net/url"
"time"
)
@stubbornella
stubbornella / media-object.jsx
Created December 18, 2014 15:29
Media Object from OOCSS and now Bootstrap written in React/jsx
'use strict';
var React = require('react/addons');
var _ = require('lodash');
var setClass = React.addons.classSet;
var MediaObject = React.createClass({
render: function () {
var classes = setClass({
'media-left': this.props.horizontalAlignment === 'left',
@Dr-Nikson
Dr-Nikson / 0-redux-auth.MD
Last active October 23, 2017 17:16
This is a redux-auth concept

This gist is about token-based authentication (who you are?) with redux

Currently it for clent-side apps only. Not for universall (isomorphic) apps. Will add it soon

0. Requirements

I'm using the promise middleware to dispatch actions like this:

@sfreiberg
sfreiberg / ldap_auth.go
Created August 16, 2012 18:23
LDAP authentication in Go
package main
import (
"github.com/jbcrail/ldap"
"fmt"
)
func main() {
server := "ldap01.example.com:389"
@jklein
jklein / Vagrantfile
Last active September 19, 2018 10:18
Vagrant file for a private WebPagetest instance
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@olslash
olslash / console
Created June 16, 2014 21:11
Testing the console's representation of data
var externalObj = {key: 'value'};
var items = {
obj: {
'string prop': 'string val',
5: 10,
nested: [[3, [5, 2]]],
'function': function(){return true;},
reference: externalObj
},
@kitplummer
kitplummer / emr-spark-launch.sh
Created November 18, 2015 15:20
Spark EMR Cluster script
# elastic-mapreduce --create --name "Spark Example Project" --instance-type m1.xlarge --instance-count 3 \
# --jobflow-role SparkRole --service-role EMR_DefaultRole \
# --bootstrap-action s3://support.elasticmapreduce/spark/install-spark --bootstrap-name "Install Spark" \
# --jar s3://elasticmapreduce/libs/script-runner/script-runner.jar --step-name "Run Spark Example Project" \
# --step-action TERMINATE_JOB_FLOW \
# --arg s3://snowplow-hosted-assets/common/spark/run-spark-job-0.1.0.sh \
# --arg s3://sparkcluster/spark-example-project-0.2.0.jar \
# --arg com.snowplowanalytics.spark.WordCountJob \
# --arg s3n://sparkcluster/hello.txt \
# --arg s3n://sparkcluster/results