Skip to content

Instantly share code, notes, and snippets.

View alexander-bobin's full-sized avatar

Alexander Bobin alexander-bobin

View GitHub Profile
url=${1:-http://localhost:8080/us/rock-n-roll-dallas/sammy}
output_path="./.lighthouse/$(date +%F-%S.%M).json"
NODE_ENV=production yarn build && NODE_ENV=production yarn start > dev.log &
# may need to wait for port
yarn run lighthouse ${url} -- --output="json" --output-path="${output_path}"
kill $(lsof -i :8080 -t)
// An Error inside a new context is not the same as an Error outside the context
var vm = require('vm')
var sandbox = { err: null, isError: null }
vm.runInNewContext('err = new Error(\'A new context is born\'); isError = err instanceof Error', sandbox)
console.log(sandbox.err instanceof Error) // false
console.log(sandbox.isError) // true
@alexander-bobin
alexander-bobin / mandrill-alternatives.md
Last active September 17, 2022 13:10
Investigation into Mandrill alternatives
@alexander-bobin
alexander-bobin / Gruntfile-browserSync-livereload.js
Created June 27, 2015 12:35
Gruntfile with browserSync and livereload
module.exports = function(grunt) {
grunt.initConfig({
watch: {
js: {
files: [
'app/assets/stylesheets/*.scss',
'app/assets/stylesheets/**/*.scss',
'app/assets/javascripts/*.js',
'app/assets/javascripts/**/*.js',
'app/views/**/*.html.erb',
@alexander-bobin
alexander-bobin / default.sublime-project
Last active August 29, 2015 14:23
Default SublimeText project file
{
"folders":
[
{
"path": ".",
"file_exclude_patterns": [
"*.sublime-workspace"
],
"folder_exclude_patterns": [
"node_modules",
@alexander-bobin
alexander-bobin / delete-merged-branches.sh
Last active August 29, 2015 14:23
Git - delete all branches merged to master
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@alexander-bobin
alexander-bobin / Gruntfile.js
Last active August 29, 2015 14:23
Gruntfile.js with watch and livereload
module.exports = function(grunt) {
grunt.initConfig({
watch: {
js: {
files: [
'app/assets/stylesheets/*.scss',
'app/assets/stylesheets/**/*.scss',
'app/assets/javascripts/*.js',
'app/assets/javascripts/**/*.js',
'app/views/**/*.html.erb'