Skip to content

Instantly share code, notes, and snippets.

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
*/
@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;
@pavvell
pavvell / youtubeID.js
Created April 10, 2016 16:15 — forked from takien/youtubeID.js
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@pavvell
pavvell / random.js
Created January 8, 2016 11:11 — forked from kerimdzhanov/random.js
Javascript — random number in a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {float} a random floating point number
*/
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
@pavvell
pavvell / pubsub.js
Created December 10, 2015 19:43 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@pavvell
pavvell / example.js
Last active December 10, 2015 19:06 — forked from addyosmani/example.js
Mediator pattern
// Example 1
mediator.name = 'Doug';
mediator.subscribe('nameChange', function(arg){
console.log(this.name);
this.name = arg;
console.log(this.name);
});
mediator.publish('nameChange', 'Jorn');
@pavvell
pavvell / README.md
Last active November 24, 2015 13:52 — forked from balupton/README.md
Node.js Best Practice Exception Handling