Skip to content

Instantly share code, notes, and snippets.

View nelldnine's full-sized avatar

Nell David Soledad nelldnine

  • Cebu, Philippines
  • 19:19 (UTC +08:00)
View GitHub Profile
@nelldnine
nelldnine / routes.js
Created July 31, 2018 20:22 — forked from rcanepa/routes.js
Private routes with React Router v4
function PrivateRoute ({component: Component, authenticated, ...rest}) {
return (
<Route
{...rest}
render={(props) => authenticated === true
? <Component {...props} />
: <Redirect to={{pathname: '/login', state: {from: props.location}}} />}
/>
)
}
@nelldnine
nelldnine / gist:2ef194cfae5f691bf074a0c27b35c927
Created October 24, 2017 06:51 — forked from imjakechapman/gist:9945290
iOS 7 fix for not triggering select's onChange event
$.fn.quickChange = function(handler) {
return this.each(function() {
var self = this;
self.qcindex = self.selectedIndex;
var interval;
function handleChange() {
if (self.selectedIndex != self.qcindex) {
self.qcindex = self.selectedIndex;
handler.apply(self);
}
@nelldnine
nelldnine / 0-react-hello-world.md
Created September 22, 2017 05:27 — forked from danawoodman/0-react-hello-world.md
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@nelldnine
nelldnine / PostGIS install
Created July 28, 2016 07:56 — forked from sholloway/PostGIS install
Set up a spatial database with PostGIS on EC2 using an EBS.
Steps:
Set up EBS
21Created 1 TB EBS
Created 64 Bit Amazon Linux AMI 2012.09 M1 Medium 3.7 gb ram, 2 ECUs
Connect to ec2 instance via ssh
chmod 400 IFS-KeyPair.pem
ssh -v -i IFS-KeyPair.pem ec2-user@ec2-54-234-14-65.compute-1.amazonaws.com
Note: Do not replace ec2-user with your user id. This is a AWS Amazon AMI requirement.