Skip to content

Instantly share code, notes, and snippets.

@alecrajeev
alecrajeev / README.md
Last active March 26, 2016 08:30
United States Congressional Districts Hexagons

U.S. Congressional Districts as Hexagons.

Background

The purpose of this map as detailed on Daily Kos is to represent the congressional districts in the United States accurately. Currently it is difficult to show the districts because some such as those in New York City are very small, while others like Montana are the size of an entire state. Previosly the maps needed to be zoomable to see the districts containing cities. Other represntations such as cartograms warped the country's shape. This map attempts to fix that by giving each congressional district equal area i.e. five regular hexagons.

According to the original Daily Kos article, the map was built by Daniel Donner.

Porting the Map

I did not design the map. This project's purpose is to port the map to a more useable format. I ported the map t

@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 12, 2025 21:24
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
#
# install daemon preconditions
#

include_recipe "apt"

mysql_root_password = "change me"
mysql_port = "3306"
wordpress_db = "wordpressdb"
@s2t2
s2t2 / text_reader.rb
Created April 12, 2015 03:46
reads text from a public github repository
require 'github_api'
github = Github.new
dir = github.repos.contents.get :user => 's2t2', :repo => 'text', :path => '/'
files = dir.map{|f|
github.repos.contents.get :user => 's2t2', :repo => 'text', :path => f.path.to_s
}
@c-lliope
c-lliope / money.rb
Created March 27, 2015 05:21
Reports on the status of your goals in Simple, and catches them up if necessary
require 'capybara/poltergeist'
require 'ruby-progressbar'
session = Capybara::Session.new(:poltergeist)
session.visit("https://bank.simple.com/signin")
session.fill_in("username", with: "USERNAME")
session.fill_in("password", with: "PASSWORD")
session.click_on("Sign in")
@brattonc
brattonc / README.md
Last active April 3, 2025 17:43
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.
@obfusk
obfusk / break.py
Last active December 7, 2024 13:12
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@igrigorik
igrigorik / bq.sql
Last active January 17, 2020 05:23
/* count of issues opened, closed, and reopened on 2019/01/01 */
SELECT event as issue_status, COUNT(*) as cnt FROM (
SELECT type, repo.name, actor.login,
JSON_EXTRACT(payload, '$.action') as event,
FROM `githubarchive.day.20190101`
WHERE type = 'IssuesEvent'
)
GROUP by issue_status;
@kosamari
kosamari / index.html
Last active March 27, 2016 03:23
D3.js Hanabi
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<style>
body {
background: #222;
color:#fff;
font-family: "Helvetica Neue", Helvetica, sans-serif;
@koistya
koistya / DefaultLayout.jsx
Last active July 1, 2021 16:05
React.js (ReactJS) Page and Layout components. For a complete sample visit https://github.com/kriasoft/react-starter-kit and http://reactjs.kriasoft.com (demo)
/**
* Page layout, reused across multiple Page components
* @jsx React.DOM
*/
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var Navigation = require('../components/Navigation.jsx');
var DefaultLayout = React.createClass({