Skip to content

Instantly share code, notes, and snippets.

@makella
makella / readme.md
Last active December 6, 2019 07:51
Spin the color wheel!!

Spin the color wheel!

Inside of CARTO Builder we offer a set of default color schemes, CARTOColors, that can be used for both qualitative and quantitative data.

But what about the times when you want to customize the colors on your map, because of its theme, a predefined brand color, or just because? There are a variety of tools and guidelines available to find harmonious color combinations that can be brought into Builder to customize your map.

Another option to get started, that we outline here, is using the CartoCSS color function spin to get started with custom color schemes, particularly for qualitative data.

With the basic building blocks in place, this function can be used in a variety of ways on many different maps. To demonstrate, we'll generate a series of well-known [color harmonies](https://en.wikipedia.org/wiki/Harmony_(co

@cheungnj
cheungnj / script.sh
Last active March 6, 2024 02:35
Convert asciidoc to Github Flavored Markdown
# Adapted from https://tinyapps.org/blog/nix/201701240700_convert_asciidoc_to_markdown.html
# Using asciidoctor 1.5.6.1 and pandoc 2.0.0.1
# Install pandoc and asciidoctor
$ sudo apt install asciidoctor
$ sudo wget https://github.com/jgm/pandoc/releases/download/2.0.0.1/pandoc-2.0.0.1-1-amd64.deb
$ sudo dpkg -i pandoc-2.0.0.1-1-amd64.deb
# Convert asciidoc to docbook using asciidoctor
@fernandoaleman
fernandoaleman / clone-git-repo.txt
Last active October 20, 2023 10:37
How to clone git repo with all branches and tags
# Clone repo
git clone --mirror git@github.com/fernandoaleman/app.git app/.git
# Change into app directory
cd app
# Update git config
git config --unset core.bare
# Checkout master branch
@zenorocha
zenorocha / basic.md
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth
{-# LANG BangPatterns #-}
-- module SillyMapBench (main) where
import qualified Data.Map.Strict as Map
loopCount = 1000000
-- loopCount = 10
texts = [ "The", "quick", "brown", "fox", "jumped",
"over", "the", "lazy", "dog", "at", "a", "restaurant",
@RedFred7
RedFred7 / Memoization.rb
Created May 9, 2015 10:53
recursive memoization with hashes
require 'benchmark'
def factorial(x)
x == 1 ? 1 : x * factorial(x-1)
end
factorial_hash ||= Hash.new do |hash,key|
key == 1 ? (key = 1) : (hash[key] = key * hash[key-1])
end
@RedFred7
RedFred7 / FizzBuzz.rb
Created May 7, 2015 21:58
3 approaches to solving FizzBuzz
require 'benchmark'
# using simple conditional statements
def conditional(n)
if (n % 3 == 0) && (n % 5 != 0)
'Fizz'
elsif (n % 3 != 0) && (n % 5 == 0)
'Buzz'
elsif (n % 3 == 0) && (n % 5 == 0)
'FizzBuzz'
@karlhorky
karlhorky / vagrant-port-forwarding.md
Last active November 16, 2017 19:24 — forked from altryne/vagrant-port-forwarding.md
Vagrant Port Forwarding on OS X Yosemite

Vagrant Port Forwarding (8080 -> 80, 8443 -> 443) with pf on OSX Mavericks/Yosemite

This guide is a fork from this gist.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

1. Create the anchor file

Create an anchor file under /etc/pf.anchors/com.vagrant with your redirection rule like:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
@steve-jansen
steve-jansen / README.md
Last active February 23, 2024 22:38
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@abayer
abayer / jenkins-git-backup.sh
Last active January 8, 2023 09:19
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master