Skip to content

Instantly share code, notes, and snippets.

@pavvell
pavvell / package.json
Created January 9, 2021 19:28
lambda-typescript-packages
{
"name": "ts-lambda-template",
"version": "1.0.0",
"description": "",
"main": "src/index.ts",
"scripts": {
"build": "webpack",
"test": "npm run build; mocha tests/"
},
"author": "",
@pavvell
pavvell / tsconfig.json
Created January 9, 2021 19:22
lambda-typescript-tsconfig
{
"compilerOptions": {
"target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
"sourceMap": true, /* Generates corresponding '.map' file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"strict": true, /* Enable all strict type-checking options. */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"esModuleInterop": true, /* Enables emit interoperability be
@pavvell
pavvell / webpack.config.js
Created January 9, 2021 19:19
lambda-typescript-webpack-config
module.exports = {
entry: ['./src/index.ts'],
target: 'node',
output: {
path: `${process.cwd()}/dist`,
filename: 'index.js',
library: 'lambda-name',
libraryTarget: 'commonjs2'
},
optimization: {

Interview

General

  • Your favorite technology stack for development.
  • Talk about your preferred development environment.
  • What did you learn yesterday/this week?
  • Can you describe the difference between progressive enhancement and graceful degradation?
  • How would you optimize a website's assets/resources?
  • Explain some of the pros and cons for CSS animations versus JavaScript animations.
@pavvell
pavvell / index.js
Created May 22, 2017 11:52 — forked from schnerd/index.js
Using Chrome as an automated screenshot tool
const CDP = require('chrome-remote-interface');
const argv = require('minimist')(process.argv.slice(2));
const file = require('fs');
// CLI Args
const url = argv.url || 'https://www.google.com';
const format = argv.format === 'jpeg' ? 'jpeg' : 'png';
const viewportWidth = argv.viewportWidth || 1440;
const viewportHeight = argv.viewportHeight || 900;
const delay = argv.delay || 0;
@pavvell
pavvell / ngrxintro.md
Created April 30, 2017 06:58 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@pavvell
pavvell / gist:cae8ee5e5fdf15e9dbcad510a7933edf
Created September 16, 2016 21:15 — forked from billerickson/gist:1398077
Multilinqual - Add Photographer Name and URL fields to media uploader
<?php
/**
* Add Photographer Name and URL fields to media uploader
*
* @param $form_fields array, fields to include in attachment form
* @param $post object, attachment record in database
* @return $form_fields, modified form fields
*/
// how many weeks in a month of a given date
function weeksInMonth(dateObj) {
function daysInDate(dateObj){
var d = new Date(dateObj.getFullYear(), dateObj.getMonth() + 1, 0);
return d.getDate();
}
return daysInDate(dateObj) / 7;
}
// how many days in a given date?
function daysInDate(dateObj){
var d = new Date(dateObj.getFullYear(), dateObj.getMonth() + 1, 0);
return d.getDate();
}
console.log(daysInDate( new Date() ));
@pavvell
pavvell / button-animated.less
Created July 29, 2016 15:49 — forked from himynameisdave/button-animated.less
Animated CSS Gradient Complete
.button {
background-size: 100%;
background-image: linear-gradient(#fff, #ccc);
border-radius: 0.45rem;
border: 1px solid #ddd;
cursor: pointer;
color: #333;
display: inline-block;
font-size: 1.25rem;
font-weight: 300;