Skip to content

Instantly share code, notes, and snippets.

@s2t2
s2t2 / README.md
Created March 18, 2017 06:37 — forked from pykerl/README.md
Color scheme picker using ColorBrewer scales.
Color scheme picker using ColorBrewer scales

A color scheme picker based on Mike Bostock's visual reference to every ColorBrewer scale (colors by Cynthia Brewer). Not perfect, but just a first try.

Mike Bostock's color brewer scales are available in CSS and JS format.

Click on a palette to change the color scheme. The data is based on 2010 US Census blocks for Georgia aggregated into grid squares.

@s2t2
s2t2 / .block
Created March 18, 2017 06:38 — forked from mbostock/.block
Every ColorBrewer Scale
license: gpl-3.0
@s2t2
s2t2 / curl.md
Created April 13, 2017 19:38 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

require "pry"
require "mechanize"
require "pdf-reader"
URL = "http://employmentsummary.abaquestionnaire.org/"
agent = Mechanize.new
agent.pluggable_parser.pdf = Mechanize::File # ... not sure whether to use Mechanize::Download or Mechanize::File
page = agent.get(URL)
@s2t2
s2t2 / rails http status codes
Created May 26, 2017 20:49 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@s2t2
s2t2 / favs_controller
Created May 27, 2017 02:35
rails scaffold controller
class FavsController < ApplicationController
before_action :set_fav, only: [:show, :edit, :update, :destroy]
# GET /favs
# GET /favs.json
def index
@favs = Fav.all
end
# GET /favs/1
@s2t2
s2t2 / README.md
Last active June 4, 2017 21:29
some programming exercises

Programming Exercises

IMPORTANT NOTE: My approach for this exercise included a narrow scope of simply solving the problems. My approach did not focus on refactoring all code into classes and functions, although I did create some functions for the last problem (name scores). Also, my approach did not focus on performance optimization, although I did end up making some choices with performance in mind (see comments).

Problem #19: Sundays

How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?

Source: https://projecteuler.net/problem=19

require "pry"
class Calculation
attr_accessor :equation
alias :eq :equation
# @param [String] equation An input string containing a math equation.
# The only supported operations are addition, subtraction, multiplication, and division.
# The equation is assumed to be valid, with spaces between operators, and all operands being numbers.

Privacy Policy Thank you for using our services. This privacy policy went into effect on May 18, 2016.

Weather Underground, a service of The Weather Company, an IBM Business, (sometimes, “we” or “us”) is committed to protecting your privacy. This Privacy Policy is important and we encourage you to carefully read it.

This Privacy Policy discloses how we collect, use and share information that we gather about you on wunderground.com ®, wxquickie.com, weatherquickie.com, wundermap.com, i.wund.com, m.wund.com websites (the “Sites”), Wunderground, WunderStation, and Storm mobile applications, as well as our software applications, mobile applications, and other websites and services that reference or link to this Privacy Policy (together, the “Services”). This Privacy Policy also describes the choices you have regarding our use of and your ability to correct the information. The Services do not include websites, mobile applications or other services that link to another privacy policy.

How We Collect and Use Per

Privacy Policy

We will never sell, rent, or share any of your personal data with anyone.

The Dark Sky API does not collect or store any personally-identifiable information.

If you sign up for a Dark Sky API account, the Dark Sky API Developer Site collects and stores your identifying information for communication and billing purposes. Contact information is stored securely upon our own servers. Billing information is sent directly from your web browser to our payment processor (Stripe) and is never seen by our servers. The Dark Sky API Developer Site also uses Google Analytics (http://www.google.com/analytics) to collect usage statistics. This data is anonymous, and does not transmit any personally identifying information to either Google or ourselves.

If you have any questions, please don't hesitate to email us at [email protected].