Skip to content

Instantly share code, notes, and snippets.

View adg29's full-sized avatar
📱

Alan Garcia adg29

📱
View GitHub Profile
@jstcki
jstcki / README.md
Last active May 25, 2021 11:36
Swiss Cantons and Municipalities with React
@slashdotdash
slashdotdash / Gruntfile.js
Created February 19, 2014 22:15
Grunt config to with task to compile React .jsx files to .js
/*global module:false*/
module.exports = function(grunt) {
grunt.initConfig({
react: {
jsx: {
files: [
{
expand: true,
cwd: 'public/js',
@Noitidart
Noitidart / about.md
Last active April 13, 2022 17:52 — forked from antichris/about.md
Adds a fully functional "Fork" button to your own Gist.

Fork your own Gist

This is a script that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well). Meaning you will have to run the script every new page load.

Firefox

Copy the contents from bookmarklet.js, open Scracthpad (Ctrl+F4), paste it there. Back in browser, swwitch to tab with your Gist you want to fork. Back in Scratchpad, "Run" it. Save and/or bookmark the Scratchpad file for future use.

@markmarkoh
markmarkoh / README.md
Last active March 23, 2017 03:21
Datamaps with custom map data

This example uses custom map data that includes counties in the state of New York. Custom map data is specified with geographyConfig.dataUrl, which will attempt to make d3.json request to that URL.

In this example, counties are referred to by their FIPs code.

The data was converted from a .SHP file to TopoJSON, instructions to do that here

More DataMaps examples here

@andrewxhill
andrewxhill / DataKind.md
Last active January 3, 2016 06:29
DataKind mapping crash course

Short link to this document http://bit.ly/Kh6TbW

Data for today's course is available from Nijel.org. Instead of downloading the data locally, we are just going to copy the URL to the public CSV of data, http://nijel.org/nysewage/ssoreports.csv. Select the URL http://nijel.org/nysewage/ssoreports.csv and copy to your clipboard.

Importing data

There are a few options in CartoDB for adding data to your account.

  1. Drag and drop files to your dashboard (CSV, KML, SHP, etc.)
  2. Paste URLs into the import menu
@KoGor
KoGor / README.md
Last active March 8, 2018 07:54
Marker animation along SVG <path> element with D3.js
@biovisualize
biovisualize / index.html
Last active December 30, 2015 23:59
Invoice using a minimalist d3 templating system
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<script type='text/javascript' src="http://d3js.org/d3.v3.min.js"></script>
<script type='text/javascript' src="infos.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
@gonzalo-bulnes
gonzalo-bulnes / XXXXXXXXXXXXX_add_authentication_token_to_users.rb
Last active March 6, 2019 15:15
(Update: I've packaged this gist into a gem to make its use easier, see: https://github.com/gonzalo-bulnes/simple_token_authentication.) Add token authentication to your Rails API. Follows the José Valim recomendations and is fully compatible with Devise (tokens are created the first time users sign in). See https://gist.github.com/josevalim/fb7…
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb
class AddAuthenticationTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :authentication_token, :string
add_index :users, :authentication_token, :unique => true
end
end
@bsmithgall
bsmithgall / top_stations.R
Created November 22, 2013 05:47
Original version of top_stations.py from github.com/bsmithgall/citibike
library('RCurl')
library('RJSONIO')
library('igraph')
stations.url <- getURL('http://citibikenyc.com/stations/json')
dist.url <- getURL('appservices.citibikenyc.com/data2/stations.php')
# prep stations for kmeans clustering
stations.prep <- function(url) {
stations.json2 <- fromJSON(url, method='C')
@alvaromorales
alvaromorales / index.html
Created November 11, 2013 18:57
Circular Heat Chart of Taxi Pickups in Boston
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="http://prcweb.co.uk/lab/circularheat/js/circularHeatChart.js"></script>
<script type="text/javascript">
var taxicabData = {"Charles Playhouse": [2226064, 3129361, 2439844, 177241, 147456, 284089, 498436, 1684804, 3147076, 3186225, 2660161, 2808976, 2650384, 2446096, 2505889, 2380849, 2643876, 2839225, 4276624, 4452100, 3621409, 3806401, 3104644, 1841449, 1708249, 1243225, 558009, 87616, 94249, 240100, 597529, 3154176, 5626384, 4583881, 3579664, 3717184, 3489424, 4536900, 4756761, 3845521, 3186225, 4618201, 6411024, 6416089, 5494336, 5764801, 6502500, 4639716, 4048144, 4787344, 3101121, 167281, 161604, 348100, 883600, 5062500, 7717284, 5466244, 3802500, 3759721, 4145296, 4524129, 4571044, 3912484, 4280761, 5098564, 7767369, 7612081, 6497401, 7214596, 6864400, 5058001, 5574321, 6295081, 3869089, 212521, 181476, 436921, 866761, 4431025, 6543364,