Skip to content

Instantly share code, notes, and snippets.

View tracklist.txt
1. erell ranson - if we never try (sw amnesia interpretation) [kalahari oyster cult]
2. george t - force majeure [honchos]
3. junkie sartre - you can turn it on [decore]
4. russ gabriel - bossatronic [freshstart]
5. halo varga - in da groove [ng trax]
6. souldoubt - haunted house [surreal]
7. skee mask - trackheadz [ilian tape]
8. bandulu - long count [foundation sound]
9. bandulu - repercussions [foundation sound]
10. dj sports - akrasia (central mix) [help]
View debugging-memory-leaks.md

Debugging Memory Issues in Node

This guide summarizes some helpful strategies and resources encountered while debugging memory usage in the hashicorp/learn repository.

Diagnosing memory issues

In JS, memory issues occur when old objects aren't garbage collected, and pile up on the heap. We can observe the issue by noting performance degradation over time, or by maxing out memory within a single program.

Typically memory issues are discovered because performance slows down. You might also encounter this fun error if your program runs out of memory:

@wkentdag
wkentdag / README.md
Last active Aug 20, 2019
make commands for installing and exporting fb keyframes for designers
View README.md

Installation

  1. Download and install the Keyframes Player application.
  2. Download our custom install script to your desktop. It should be saved as install-keyframes.sh.
  3. Open the Terminal application (inside your /Applications folder - it might be under the Applications/Utilities subdirectory)
  4. Type sh ~/Desktop/install-keyframes.sh, and hit enter in order to install the Keyframes extension and its dependencies.
    1. At some point the script will ask permission to install Xcode Tools. Say yes.
    2. At some point it will ask you to enter your password. When you type it in, the characters will not display for security reasons. So type carefully, and then hit enter. If you mistype, it will ask you again.
  5. Some error messages and warnings may appear.
@wkentdag
wkentdag / serialize.js
Created Oct 22, 2016
serialize an object into a query string
View serialize.js
const serialize = (params) => {
let whitelist = ['category', 'order', 'search', 'number']
return (!params) ? '' : '?' + Object.keys(params)
.filter(p => whitelist.includes(p))
.map(p => `${p}=${params[p]}&`)
.reduce((p, c) => p + c)
.slice(0, -1)
}
View dd_vs_community_20161010121137.txt
This file has been truncated, but you can view the full file.
[17E8:1B4C][2016-10-10T12:11:36]i001: Burn v3.7.4906.0, Windows v10.0 (Build 14393: Service Pack 0), path: C:\Users\will\AppData\Local\Temp\{8FD4FD17-D36B-45A1-88F3-6C7580B36C40}\vs_community.exe, cmdline: '/ChainingPackage ct3!!a6ae4dbe0137be43afb0291c5d53530f-ct!!4A7F21E333A544F990406B9347064B63'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing string variable 'SKUFriendlyName' to value 'VS Community'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing numeric variable 'SKUFriendlyID' to value '1800'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing string variable 'ExtraEditionDisplayName' to value '#loc.slipstream'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing string variable 'EditionDisplayName' to value 'Community 2015'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing string variable 'SKUFullName' to value 'vs_community_SlipStream_3'
[17E8:1B4C][2016-10-10T12:11:36]i000: Initializing numeric variable 'VSUpdateGeneralVersion' to value '3'
@wkentdag
wkentdag / childpx-snip.md
Created Oct 2, 2016
good way to call child processes inside a node script
View childpx-snip.md

elegantly call child processes within node

const node = require('when/node')
const {exec} = require('child_process')
const tplTestPath = path.join(__dirname, 'example')

function npmInstall (dir) {
  return node.call(exec, 'npm install', { cwd: dir })
}
View relevant wordpress tags.js
let relevant = ['ID', 'author', 'date', 'modified', 'title', 'URL', 'content', 'excerpt', 'slug', 'status', 'type', 'comment_count', 'featured_image', 'tags', 'categories', 'attachments']
return Object.keys(post).filter(prop => relevant.includes(prop)).map(prop => {
switch (prop) {
case 'foo':
break
default:
console.log(prop)
@wkentdag
wkentdag / index.jade
Created Aug 16, 2016
side-by-side comparison of a simple index page in jade and sugarML. from https://github.com/wkentdag/pow
View index.jade
extends layout
block content
main
section
- var post = locals.data.headlines[0]
#hero(style=bg)
a(href=post.perma)
h1= post.title
img(src= post.image)
.hero-overlay
@wkentdag
wkentdag / index.md
Last active Aug 16, 2016 — forked from jescalan/index.md
Differences between jade and the spike-standards stack
View index.md

Spike v0.11.0 Migration Guide

In this release of spike, we switch posthtml for reshape. Reshape is a complete rewrite of posthtml by the static-dev team with several significant differences:

  • It returns a function by default, so that its results can be used as client-side templates
  • It has a much more clear and robust error reporting system, reporting errors that include the line/col in the original source, and exposing a code snippet to show where it came from
  • It has more clearly written documentation, more thorough tests, consistent code style, and 100% coverage on all core modules

However, as a consequence of this move, the jade plugin is no longer available. The jade plugin was always a hack, and had several crippling caveats. In addition, jade does not fit well with reshape's philosophy of breaking functionality down into small modules. As such, we have replaced ja

View participation.server.model.js
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
Company = mongoose.model('Company'),
Loan = mongoose.model('Loan');