Skip to content

Instantly share code, notes, and snippets.

View rxgx's full-sized avatar

Ryan Gasparini rxgx

View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active June 1, 2024 19:35
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@ceejbot
ceejbot / interview_questions.md
Last active March 8, 2024 21:49
I have now LEAKED the questions I ask in interviews! Prep now and hack this test!

Interview outline

Questions variation 2

  1. intro (read script below)
  2. Tell me a story about the last time you taught someone something at work. what was the process like? what went well / what was challenging? (This is a warmup softball question. The candidate will be prepared for something like this, and will relax while answering it.)
  3. Tell me a story about the last thing someone taught you at work. (Looking for: ability to learn, learning strategies.)
  4. Substitute for #2 for more senior candidates: How do you deal with stress? (Looking for: any thoughtful approach at all.)
  5. What’s the hard part of [your job]? (Look for reasons why it's hard; what the candidate is doing to learn more about making it easy. Is it technical or do they have the awareness to talk about people things?)
  6. Tell me a story about a time modularity (or encapsulation) worked out for you. how do you pick where to encapsulate? what’s good about modularity? what’s difficult? (This is the single most important question fo
@rocketraman
rocketraman / .gitconfig
Last active January 17, 2024 01:52
.gitconfig aliases useful for gitworkflow (https://github.com/rocketraman/gitworkflow)
[alias]
# Basically `log --oneline --decorate --graph` with different colors and some additional info (author and date)
lg = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)'
# lg (see above) with --first-parent
lgp = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)' --first-parent
# https://stackoverflow.com/questions/61510067/show-specific-commits-in-git-log-in-context-of-other-commits
hl = "!f() { cd -- ${GIT_PREFIX:-.}; grep --color -E \"$(git log --pretty=%h \"$@\" | tr '\n' '|')\" || true; }; f"
hlp = "!f() { cd -- ${GIT_PREFIX:-.}; less -R -p $(git log --pretty=%h \"$@\" | tr '\n' '|'); }; f"
@kristoferjoseph
kristoferjoseph / webpack.config.js
Created June 6, 2016 18:28
postcss part of my webpack config
postcss: function() {
return [
postcssImport({
onImport: function (files) {
files.forEach(this.addDependency)
}.bind(this)
}),
customProperties(),
autoprefixer
]
@jamsesso
jamsesso / dev-server.js
Last active August 24, 2020 13:27
Webpack dev server with a better proxy (http-proxy-middleware)
var express = require('express');
var path = require('path');
var webpackConfig = require('./webpack.config');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var proxyMiddleware = require('http-proxy-middleware');
var devConfig = webpackConfig.devServer;
var app = express();
@imjasonh
imjasonh / markdown.css
Last active May 24, 2024 22:56
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@nickfishman
nickfishman / testGzipKnox.js
Created May 4, 2013 07:49
Proof of concept of streaming a file through zlib and into s3, without storing the entire file in memory. knox-mpu provides support for Amazon's multipart upload, which allows us to stream an arbitrary amount of data without specifying the content-length ahead of time.
/**
* Proof of concept of streaming a file through zlib and into s3,
* without storing the entire file in memory. knox-mpu provides support
* for Amazon's multipart upload, which allows us to stream an arbitrary
* amount of data without specifying the content-length ahead of time.
*/
var knox = require('knox'),
fs = require('fs'),
zlib = require('zlib'),
MultiPartUpload = require('knox-mpu');