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
@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)
{
"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

{
"log": {
"version": "1.2",
"creator": {
"name": "F12 Developer Tools",
"version": ""
},
"entries": [
{
"startedDateTime": "2016-06-22T14:25:35.670Z",
@nelsonic
nelsonic / portable-node.md
Created August 29, 2016 10:10 — forked from domenic/portable-node.md
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@nelsonic
nelsonic / Main.elm
Created January 3, 2018 17:15 — forked from chrisbuttery/Main.elm
Elm 0.17. A simple Mouse.moves example
import Html exposing (Html, text, div)
import Html.App as Html
import Mouse exposing (..)
main =
Html.program
{ init = init
, view = view
, update = update
, subscriptions = subscriptions
@nelsonic
nelsonic / introrx.md
Created February 1, 2018 20:21 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing