Skip to content

Instantly share code, notes, and snippets.

View arthur-flam's full-sized avatar
☀️
Crafting software for fun and profit

Arthur Flam arthur-flam

☀️
Crafting software for fun and profit
View GitHub Profile

Keybase proof

I hereby claim:

  • I am arthur-flam on github.
  • I am arthurflam (https://keybase.io/arthurflam) on keybase.
  • I have a public key whose fingerprint is 6E24 D6DC 25E7 6467 8EF1 3317 F546 7E61 0F0B B376

To claim this, I am signing this object:

@arthur-flam
arthur-flam / read-influxdb.r
Last active August 29, 2015 14:25
Get data from influxdb 0.9+ into R. Might be turned into a package since influxdb-R is obselete.
# MIT licence - https://tldrlegal.com/license/mit-license
# Arthur Flam - Lookies - 2015
library(httr)
library(rjson)
HOST = "ip.ip.ip.ip"
PORT = "8086"
PROTOCOL = "http"
DATABASE = "test_db"
# become a coder
while true; do
http GET 'http://HOSTNAME/votePlugin.php' blogId==BLOG_ID vote==1 track=$(date +"%s")
sleep $[ ( $RANDOM % 1000 ) + 1 ]s
done
@arthur-flam
arthur-flam / is.Dauphine.R
Last active December 19, 2015 06:19
Vérification de diplôme : Université Paris Dauphine
## Arthur Flam
## @ArthurFlam
## Ecole Centrale Paris, ex-Dauphine
## Vérifier si quelqu'un vient bien de Dauphine
library(RCurl)
library(rjson)
library(XML)
@arthur-flam
arthur-flam / is.ECP.R
Last active December 19, 2015 08:08
Vérification de diplôme : Ecole Centrale Paris (ECP)
## Arthur Flam
## @ArthurFlam
## Ecole Centrale Paris, ex-Dauphine
## Vérifier si quelqu'un vient bien de Centrale Paris
library(RCurl)
library(rjson)
library(XML)
@arthur-flam
arthur-flam / is.CTI.R
Last active December 19, 2015 08:09
Vérification de diplôme : ingénieur CTI
## Arthur Flam
## @ArthurFlam
## Ecole Centrale Paris, ex-Dauphine
## arthur.flam@gmail.com
## Vérifier si quelqu'un est bien ingénieur CTI
library(RCurl)
library(rjson)
library(XML)
@arthur-flam
arthur-flam / sleep.R
Last active December 19, 2015 08:38
Random exponential sleep + warns it sleeps
#' Random sleep
#'
#' Random exponential sleep + prints "sleeping".
#'
#' @param short Toogle shorter wait time
#' @references \url{https://twitter.com/ArthurFlam}
# @ArthurFlam
# random Sleep function
# Prints out
@arthur-flam
arthur-flam / ui.R
Created July 8, 2013 23:02
Premier exemple
shinyUI(bootstrapPage(
selectInput(inputId = "n_breaks",
label = "Number of bins in histogram (approximate):",
choices = c(10, 20, 35, 50),
selected = 20),
checkboxInput(inputId = "individual_obs",
label = strong("Show individual observations"),
value = FALSE),
@arthur-flam
arthur-flam / server.R
Last active December 19, 2015 12:09
Premier exemple. Merci RStudio !
shinyServer(function(input, output) {
output$main_plot <- renderPlot({
hist(faithful$eruptions,
probability = TRUE,
breaks = as.numeric(input$n_breaks),
xlab = "Duration (minutes)",
main = "Geyser eruption duration")
@arthur-flam
arthur-flam / unfollowers.r
Created November 13, 2013 23:28
Twitter: follower growth + unfollowers Run the shell script first !
library(RCurl)
library(stringr)
library(twitteR)
library(ggplot2)
library(plyr)
## Setup twitter credentials once (with an API app key)
# cred <- OAuthFactory$new(consumerKey="XXXXX",
# consumerSecret="XXXXX",
# requestURL="https://api.twitter.com/oauth/request_token",