Skip to content

Instantly share code, notes, and snippets.

View adelaide01's full-sized avatar

Adelaide Chen adelaide01

View GitHub Profile
@mbostock
mbostock / .block
Last active June 11, 2018 03:00
Asynchronous Queue
license: gpl-3.0
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@alexhornbake
alexhornbake / index.html
Last active May 3, 2024 10:48
Generate Path for Curly Bracket
<html>
<title>Curly Bracket</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
.curlyBrace {
stroke: #000000;
stroke-width: 10px;
@edouard-lopez
edouard-lopez / gironde-epci.topo.json
Last active December 14, 2017 19:04
D3 + TopoJSON + Leaflet
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@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>
@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
@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();
@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):
@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: