Skip to content

Instantly share code, notes, and snippets.

View adelaide01's full-sized avatar

Adelaide Chen adelaide01

View GitHub Profile
anonymous
anonymous / style.json
Created January 10, 2018 04:17
Positron
{
"version": 8,
"name": "Positron",
"metadata": {
"mapbox:autocomposite": false,
"mapbox:type": "template",
"mapbox:groups": {
"b6371a3f2f5a9932464fa3867530a2e5": {
"name": "Transportation",
"collapsed": false
@miguelvb
miguelvb / index.html
Created March 13, 2017 20:35
saving svg layer in leaflet map
<!DOCTYPE html>
<html>
<head>
<title>Save SVG - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.3/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script>
<script src="https://unpkg.com/leaflet-image@latest/leaflet-image.js"></script>
@ryanbaumann
ryanbaumann / index.html
Last active February 3, 2023 08:05
Example of loading large geojson into Mapbox GL JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.css' rel='stylesheet' />
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />
@elimisteve
elimisteve / links.md
Last active August 4, 2016 05:02
Google Searches of ReviewJournal.com for references to the 214 federal prisoners whose sentences Obama commuted
@enjalot
enjalot / README.md
Last active January 15, 2021 09:48
Mapbox-gl -> d3 projection

This example shows how to convert from a Mapbox-gl map projection to a d3.geo Mercator projection. This allows you to take full advantage of all the d3.geo based functions and examples while also leveraging the power and ease-of-use of mapbox-gl

Much credit goes to @vicapow who developed viewport-mercator-project where he figured out the necessary calculations to make this work.

Built with blockbuilder.org

@dannguyen
dannguyen / compjour-2016-WARN-pdfs-pdfplumber.md
Last active March 17, 2021 20:41
COMPJOUR examples of using pdfplumber on California WARN data

Using the pdfplumber library to extract tabular data from California's WARN Act data documents

(this writeup supplements a computational journalism assignment)

Jeremy Singer-Vine has been working on a new PDF-to-text/spreadsheet library native to Python: pdfplumber

The California WARN Act PDFs can be found at:

@vinovator
vinovator / DemergePDF.py
Created November 17, 2015 10:35
Divide a PDF file into 2 separate PDF files using PyPDF2 module
#Python 2.7.6
#DemergePDF.py
#Gets raw_inputs of 1 PDF file names from user and demerge into 2
import PyPDF2
import os
def getFileNameFromUser (file, path):
pdf_file_name = raw_input("Enter {0} name: ".format(file))
if pdf_file_name in os.listdir(path):
@a-guerrero
a-guerrero / html5-canvas-post-to-facebook-base64.js
Created November 4, 2015 19:27
Post a BASE64 Encoded PNG Image to facebook
// Post a BASE64 Encoded PNG Image to facebook
function PostImageToFacebook(authToken) {
var canvas = document.getElementById("c");
var imageData = canvas.toDataURL("image/png");
try {
blob = dataURItoBlob(imageData);
} catch (e) {
console.log(e);
}
var fd = new FormData();
@wuhland
wuhland / MergeSHP.md
Last active June 21, 2023 08:06
Merging Shapefiles From Command Line with GDAL\OGR2OGR

First put all the shapefiles you want merged in one directory than I run this bash script in the folder

#!/bin/bash

file="./final/merge.shp"

for i in $(ls *.shp)
do
@ronaldsmartin
ronaldsmartin / GoogleSheetJson.md
Last active December 16, 2023 06:53
Google Spreadsheet JSON Queries

SheetAsJSON + Filtering

This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.

Minimal Usage

The following parameters are required for the script to work.

https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>