Skip to content

Instantly share code, notes, and snippets.

// Mutating data
const favoriteNumbers = [1,2,3];
// favoriteNumbers.push(4); // Mutated favoriteNumbers
const newFavoriteNumbers = [...favoriteNumbers, 4]; // No mutation here!
const removedOne = favoriteNumbers.slice(1, 2); // Mutates the array, no good
@bookcasey
bookcasey / Node-pg-and-heroku-ssl.md
Last active September 25, 2021 19:38
How to fix Node/pg version compatibility issues, and set the correct SSL options for heroku

How to fix common Node/pg compatability issues locally and on Heroku

Certain versions of the pg library do not play nice with certain versions of node.

The following combinations are known to work:

  • Node v12 and pg@7
  • Node >=v14 and pg@8

Additionally, different versions of pg on heroku requires certain ssl options to be set certain ways.

require "rubygems"
require "chunky_png"
require "base64"
module Sass::Script::Functions
def background_noise(c, noise = 0.5, opacity = 0.08, size = 200, mono = false)
# Convert SASS numbers to Ruby classes
noise = noise.to_s.to_f if noise.is_a? Sass::Script::Number
@bookcasey
bookcasey / config.rb
Created February 22, 2012 00:48 — forked from pengwynn/config.rb
Nesta, compass, rack
# Compass Configuration
# HTTP paths
http_path = '/'
http_stylesheets_path = '/mysite/css'
http_images_path = '/mysite/images'
http_javascripts_path = '/mysite/javascripts'
# File system locations
sass_dir = 'themes/mysite/sass'