Skip to content

Instantly share code, notes, and snippets.

View nelsonic's full-sized avatar
💭
Let's Build a Better World Together!☀️

Nelson nelsonic

💭
Let's Build a Better World Together!☀️
View GitHub Profile
/**
* Copyright 2012 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nelsonic
nelsonic / mario-resize.html
Created October 26, 2013 09:10
Pet Rock HTML & JavaScript (helping a friend learn JavaScript...)
<!DOCTYPE html>
<html>
<head>
<title>
iRock - The Virtual Pet Rock
</title>
<script type="text/javascript">
var userName;
@nelsonic
nelsonic / Fake-image-upload-button
Created December 4, 2013 15:23
Changing Text on File Upload Button (Hack)
<!-- Fake Upload Button assumes we have JQUery -->
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<!-- Font awesome is optional -->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<!-- copy these over to profile.scss -->
<style>
/* This is a workaround to style the image upload button
* We googled it extensively and the best "solution" we found
* was: http://www.quirksmode.org/dom/inputfile.html
* not ideal but it works
@nelsonic
nelsonic / styled-select.html
Created December 6, 2013 15:29
Styled Select Box
<select class="styled-select">
<option class="red">Cooperation </option>
<option class="blue">Competence </option>
</select>
</p>
<style>
.styled-select {
font-size: 1.4em;
color: #DCDCDC;
@nelsonic
nelsonic / button-in-link.html
Created December 16, 2013 13:17
Non Valid HTML Markup (Button within a Link)
@nelsonic
nelsonic / css-toggle
Created February 3, 2014 15:41
CSS ONLY Toggle Button with Valid HTML
<div>
<input type="checkbox" id="switch1" name="switch1" class="switch" />
<label for="switch1">First switch</label>
</div>
<style> /* put this in buttons.scss */
input.switch:empty
{
margin-left: -999px;

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@nelsonic
nelsonic / redis-server.conf
Last active August 29, 2015 14:27 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu
# https://gist.github.com/bdotdub/714533
description "redis server"
start on runlevel [23]
stop on shutdown
exec sudo -u redis /usr/bin/redis-server /etc/redis/redis.conf
respawn
{
"B11HhPUg": {
"id": "B11HhPUg",
"name": "Opvarmet pool",
"sections": [
{
"image": "http://images2.spies.dk/images/SiteID11/SitePage/hoteller-med-opvarmet-pool.jpg?v=1",
"text": "Hører du til dem, der elsker en forfriskende dukkert i poolen, men ikke bryder sig om at give den solvarme hud et iskoldt chok? Så kan vi anbefale at du bor på et af vores hoteller, som har opvarmet pool om vinteren. Så er du garanteret en ferie med skønt badevejr!",
"title": "Opvarmet pool"
}
@nelsonic
nelsonic / gist:eeaa42dbad21cda0e1a932472ecb9648
Created June 5, 2016 16:08
Walmart Mobile node.js Setup

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics