Skip to content

Instantly share code, notes, and snippets.

View joshwiens's full-sized avatar

Joshua Wiens joshwiens

View GitHub Profile
@bahmutov
bahmutov / README.md
Last active October 4, 2023 08:35
Single command to run Node with local file access

Goal: run a simple NodeJS application inside a Docker container

Subgoal: give it access to local files.

docker run -it --rm --name example -v "$PWD":/usr/src/app -w /usr/src/app node:5-slim node index.js

output:

We're excited to have you attend one of our workshops! Here's a JavaScript (re)fresher to help you get up-to-speed on some features of the language we'll be using.

Let and Const

JavaScript has always had var:

var name = 'Ryan'
@PatrickJS
PatrickJS / gulpfile.js
Last active November 6, 2019 23:09
How to setup GulpJS, TypeScript, and Typings also see https://github.com/angular/answers-app/pull/27/files
var gulp = require('gulp');
var tsProject = ts.createProject('tsconfig.json');
var ts = require('gulp-typescript');
gulp.task('build', function() {
return tsProject.src()
.pipe(ts(tsProject))
.pipe(gulp.dest('dist'));
});
@RickCogley
RickCogley / gulpfile.js
Created January 15, 2016 02:10
Inlining-css-via-postcss-import-in-gulp-gulpfile.js
/* eslint-env node */
var concat = require('gulp-concat'),
atImport = require('postcss-import'),
/* mqpacker = require('css-mqpacker'), */
cssnano = require('cssnano'),
cssnext = require('postcss-cssnext'),
gulp = require('gulp'),
postcss = require('gulp-postcss'),
sourcemaps = require('gulp-sourcemaps'),
@chrisallenlane
chrisallenlane / nginx.conf
Last active March 14, 2020 16:57
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `example.com` and `api.example.com` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author: http://enable-cors.org/server_nginx.html
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen 127.0.0.1:443 ssl;
server_name api.example.com;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;