Skip to content

Instantly share code, notes, and snippets.

View pachevalier's full-sized avatar

Paul-Antoine pachevalier

  • Paris
View GitHub Profile
@jeantil
jeantil / algorithm.sql
Last active May 26, 2020 20:37
Code source d’Admission post-bac
--
-- le code ci-dessous a a été fortement amélioré par un effor collaboratif sur
-- https://github.com/jeantil/admission_post_bac
-- Pull requests, issues et contributions wiki sont les bienvenues.
-- Une partie du code a été rétro analysé a partir de diverses sources cf https://github.com/jeantil/admission_post_bac/wiki
--
FUNCTION gen class alea V1 relatif grp(
o_g_ea_cod_ins IN VARCHAR2,
o_g_ti_cod IN NUMBER,
@pvictor
pvictor / bb8_with_ggplot2.R
Created April 25, 2016 13:57
A Star Wars BB-8 with ggplot2 !
# BB-8 --------------------------------------------------------------------
# Inspired by Brian Hough in http://codepen.io/bhough/pen/wawrPL
# Packages ----------------------------------------------------------------
library("dplyr")
library("ggplot2")
@briatte
briatte / 01-scrape.r
Last active February 2, 2016 15:54
scrape nominative decisions published in the French "Journal officiel"
library(dplyr)
library(httr)
library(rvest)
library(stringr)
dir.create("data" , showWarnings = FALSE)
dir.create("raw" , showWarnings = FALSE)
dir.create("docs" , showWarnings = FALSE)
for (i in c(2015:1990)) {
@dannguyen
dannguyen / bash-wikipedia-pageviews.md
Last active September 12, 2018 20:19
Bash function to read Wikipedia Pageviews API and pass it into Google Static Charts API to get 120-day time series of pageviews

An example in Bash of how to use Wikipedia's newly-announced Pageviews API and pass it into Google's hopefully-eternally-functioning Static Charts API. The result is a a quick time-series chart that visualizes 120 days of pageviews for any given Wikipedia page. Shout-out to the awesome jq command-line JSON tool.

The charts are crudely labeled...with a little more work you could turn it into a more interesting comparison chart (i.e. a grouped bar chart). But for now, here's what the last 120 days of page visits look like for Donald Trump and Hillary Clinton

(I've manually edite

@jeroen
jeroen / fortran.R
Created September 16, 2015 10:11
Find CRAN packages with FORTRAN code
# Find all CRAN package with FORTRAN code
packages <- c()
base_url <- 'https://api.github.com/search/repositories?q=user:cran%20language:fortran'
for(page in 1:100){
url <- paste0(base_url, "&page=", page)
cat("Reading", url, "\n")
repos <- jsonlite::fromJSON(url)
if(!length(repos$items))
break
packages <- c(packages, repos$items$name)
@uupaa
uupaa / image.resize.in.github.flavored.markdown.md
Last active May 2, 2024 14:54
image resize in github flavored markdown.

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@cquest
cquest / referidf.sh
Last active November 30, 2016 13:46
Extraction en CSV des données de https://www.referidf.com/
# récupération des données sur https://www.referidf.com/
mkdir kml -f
for p in {1..4}; do
for m in "meuble" "non-meuble"; do
for d in "inf1946" "1946-1970" "1971-1990" "sup1990"; do
curl -q "https://www.referidf.com/kml/drihl_medianes_$p%5f$d%5f$m.kml?t=20150327" > kml/drihl_$p_$d_$m.kml
done
done
done
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/