Skip to content

Instantly share code, notes, and snippets.

/**
* Pass in an element and its CSS Custom Property that you want the value of.
* Optionally, you can determine what datatype you get back.
*
* @param {String} propKey
* @param {HTMLELement} element=document.documentElement
* @param {String} castAs='string'
* @returns {*}
*/
const getCSSCustomProp = (propKey, element = document.documentElement, castAs = 'string') => {
@juliends
juliends / nvm_install.md
Created September 17, 2019 13:46
move to NVM

Use NVM (node version manager) like we use rbenv for Ruby

First we will remove node and yarn

brew uninstall yarn
brew uninstall node  
brew uninstall node@8
@Haumer
Haumer / E001_instagram_public.rb
Created July 17, 2020 14:52
InstagramClient for the latest 12 posts
require 'json'
require 'http'
class InstagramClient
attr_reader :posts, :followers
def initialize(instagram_handle)
@instagram_handle = instagram_handle
@url = "https://www.instagram.com/#{@instagram_handle}/?__a=1".freeze
@data = JSON.parse HTTP.get(@url).to_s