Skip to content

Instantly share code, notes, and snippets.

View d-qn's full-sized avatar

Duc-Quang Nguyen d-qn

View GitHub Profile
@d-qn
d-qn / index.html
Created August 8, 2013 11:57
Scatterplot
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://polychart.com/s/third_party/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / index.html
Created August 10, 2013 17:17
FilmProfitabilityVsRatings
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / index.html
Created August 10, 2013 22:50
FilmProfitabilityVsRatings
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / index.html
Created August 10, 2013 22:58
FilmProfitabilityVsRatings
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / index.html
Created August 11, 2013 13:55
Films since 2011: rating vs profitability
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / index.html
Created August 11, 2013 14:24
Films since 2011: rating vs profitability
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='http://code.jquery.com/jquery-1.9.1.min.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts.js' type='text/javascript'></script>
<script src='http://code.highcharts.com/highcharts-more.js' type='text/javascript'></script>
<style>
@d-qn
d-qn / code.R
Created October 22, 2013 21:59 — forked from ramnathv/code.R
# read data and replace dots in names with underscores
obesity = read.csv(
'http://www.stat.berkeley.edu/classes/s133/data/obesity.csv',
stringsAsFactors = F
)
names(obesity) = gsub("\\.", "_", names(obesity))
# add column with two letter state names and
obesity = plyr::mutate(obesity,
State = str_trim(State),
@d-qn
d-qn / keybase.md
Last active September 23, 2015 19:29

Keybase proof

I hereby claim:

  • I am d-qn on github.
  • I am duc (https://keybase.io/duc) on keybase.
  • I have a public key whose fingerprint is 8D22 DA25 F4C9 C516 3B6C 68C0 62DF 32AB 0553 D36C

To claim this, I am signing this object:

@d-qn
d-qn / lausanne_OSM_city_map.R
Last active October 15, 2020 16:45
Make a minimal arty city map with R and openstreetmap data
library(tidyverse)
library(sf)
library(osmdata) # to get openstreetmap geo data
# settings
bb <- getbb('Lausanne, Switzerland') # define the bbox, will be used to fetch OSM data within that box
dest_proj <- 2056
# OSM overpass query
q <- opq(bbox = bb)