Skip to content

Instantly share code, notes, and snippets.

/**
* @param {number[][]} board
* @return {void} Do not return anything, modify board in-place instead.
*/
var gameOfLife = function(board) {
let neighbors = [0, 1, -1];
let rows = board.length;
let cols = board[0].length;
let copyBoard = [];
copyBoard.length = rows;
{"nodes":[{"id":"appworker-134.optiturn.com","group":"ot"},{"id":"production-product-research-web-jon-theiss","group":"service"},{"id":"production-smart-disposition-web-dana-dewolf","group":"service"},{"id":"production-ds-shipping-cost-app-lacey-hedley","group":"service"},{"id":"appworker-135.optiturn.com","group":"ot"},{"id":"production-smart-disposition-web-garry-leigers","group":"service"},{"id":"appworker-131.optiturn.com","group":"ot"},{"id":"production-smart-disposition-web-ted-conrow","group":"service"},{"id":"production-product-research-web-wilma-otsuka","group":"service"},{"id":"appworker-132.optiturn.com","group":"ot"},{"id":"production-product-research-web-eric-reary","group":"service"},{"id":"production-product-research-web-alvin-menkin","group":"service"},{"id":"production-ds-bulq-pricing-app-maria-thierry","group":"service"},{"id":"production-dataswamp-rails-lewis-siriano","group":"service"},{"id":"production-smart-disposition-web-troy-weltch","group":"service"},{"id":"production-ds-bob-barker-a

Keybase proof

I hereby claim:

function _openPrintScc14Window() {
const url = $state.href('print-scc14', {
scc14: vm.masterPack.scc14,
quantity: vm.masterPack.quantity,
})
$window.open(url, '_blank')
}
@akrawchyk
akrawchyk / webpack.config.js
Last active June 27, 2017 20:28
Webpack vendor and modules example
var webpack = require('webpack');
var path = require('path');
module.exports = function(env) {
return {
entry: {
// main pages JS
page1: './page1/index.js',
page2: './page2/index.js',
@akrawchyk
akrawchyk / writing-css.md
Created February 20, 2017 19:35 — forked from jednano/writing-css.md
Writing CSS

Writing CSS

This project uses cssnext, which allows us to use emerging CSS features at design time and transpile into currently-supported, browser-compatible CSS at runtime.

Styles can be found in app/styles. Inside this folder, you should familiarize yourself with the following structure:

styles
├── config
│ ├── fonts.json
@akrawchyk
akrawchyk / crawler.js
Last active June 20, 2016 18:40
Streams HTML from phantomjs after document load as ndjson
/**
* Crawler
* PhantomJS writes to stream with content of crawled pages
* Streams HTML from phantomjs after document load as ndjson
*/
'use strict'
const ndjson = require('ndjson')
const phantom = require('phantom')

The problem:

Need to find paths to SCSS assets installed with npm to be used in a gulp script with gulp-sass.

The progress:

const nodeModules = (() => {
  let base = 'node_modules';
 let modulesPath;
@akrawchyk
akrawchyk / gist:16ffe8c128e03e58b546
Created March 5, 2015 03:20
ternary operator js
var jobsCountRemaining = 2;
// ternary
var completed = jobsCountRemaining === 0 ? true : false;
return completed;
// if-else
if (jobsCountRemaining === 0) {
completed = true;
} else {
@akrawchyk
akrawchyk / inputToJSON
Last active August 29, 2015 14:00
Serialize input to JSON
/**
* Creates JSON for a single input field
*
* e.g. article[id] = 1 => { article: {id: 1}}
*
* @param {Node} inputElem - :input element to serialize
* @returns {object}
*/
var serializeInputToJSON = function(inputElem) {
var name = inputElem.name;