Skip to content

Instantly share code, notes, and snippets.

View Kevnz's full-sized avatar
💭
Writing the code

Kevin Isom Kevnz

💭
Writing the code
View GitHub Profile
@Kevnz
Kevnz / info.md
Created August 31, 2017 04:59
NPM updates

NPM V 5 and up

  • performance improvements
  • package-lock.json

NPX

explain

  • create react app
  • local modules (tape example)
@Kevnz
Kevnz / index.js
Last active August 31, 2017 04:49 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
const asciify = require('asciify');
asciify('NPX', function(err, res){ console.log(res);
console.log('yay gist')
console.log('Hi Auckland Node.JS Meetup')
});
@Kevnz
Kevnz / README.md
Created July 20, 2017 02:21 — forked from jonathantneal/README.md
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@Kevnz
Kevnz / table-builder.js
Created April 10, 2017 00:43
Create a table without a for loop - vanilla js
const buildTable = (data) => {
const body = document.querySelector('.table-container');
body.innerHTML = '';
const tbl = document.createElement('table');
const thead = document.createElement('thead');
thead.innerHTML = '<tr><th>ID</th><th>Prop1</th><th>Prop2</th><th> </th></tr>'
const tbdy = data.map((item) => {
const tr = document.createElement('tr');
tr.innerHTML = `<td>${data.prop1}</td><td>${data.prop2}</td><td>Something else</td>`;
return tr;
@Kevnz
Kevnz / mac-n-cheese.md
Last active February 22, 2017 05:45
Mac and cheese

Mac and Cheese

  • 1/2 Onion
  • 2 tbls butter
  • 2 cups of mac
  • 4 rashers of bacon
  • 2 cups of hot water
  • 1 cup milk
  • 1/4 cup clour
  • 1 pinch of salt
  • 2 cups of cheese
@Kevnz
Kevnz / rl.html
Created August 2, 2016 03:12 — forked from anotheredward/rl.html
CHCH.js Roguelike
<pre id="maze"></pre>
<script>
//Why a roguelike?
//A RL is a sweetspot between effort vs. new features
//You get something awesome every 5 LoC or even just by tweaking a single variable, and this makes it fun to program
//What's exciting about JS is that you can make something you can see in a browser, fast, and then share it with everyone
//JS being a simple to understand, practical, and easy to share language has helped it develop an awesome community
//Things to tweak
//Try adding a ghost trail to the player by not replacing their last position with a .
//Try making an AI that moves randomly, that moves towards the player, that runs away from the player (like tag)
@Kevnz
Kevnz / text.md
Created July 13, 2016 00:34
Options for a mobile game
@Kevnz
Kevnz / gist:84ec9dd7f6197d4ebc3101a91803947d
Created May 24, 2016 11:42 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@Kevnz
Kevnz / form-validation.md
Created March 24, 2016 02:46 — forked from andrewk/form-validation.md
Good Enough™ Form Validation in React

Good Enough™ Form Validation in React

…specifically React 0.13 using ES6 class syntax

Originally I was implementing the validator as a context, but then I got stung by parent context vs owner context. I'll likely return to the context model when React's context implementation is more final (looks like they're moving towards parent context over owner context, which I'd prefer).

Requirements

  • markup must match our existing markup, for UX consistency.
  • inputs are re-usable components with an explicit contract -- they are responsponsible for their error display and any required filtering of their value.
/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;