Skip to content

Instantly share code, notes, and snippets.

View steren's full-sized avatar
🏃‍♀️

Steren steren

🏃‍♀️
View GitHub Profile
@steren
steren / pingstats.sh
Last active January 10, 2016 16:06
ping every 30 sec and store result in a file, used to diagnose internet connection
#!/bin/bash
FILE=$(echo pingstats-$(date '+%Y-%m-%d-%H-%M').csv)
echo "datetime,min,avg,max,stddev" > ${FILE}
while true
do
NOW=$(date -u +"%Y-%m-%d %H:%M:%S")
# retrieve data from ping: min,avg,max,stddev
VALUES=$(ping -c 4 steren.fr | tail -1 | awk '{print $4}' | sed 's/\//,/g')
echo "${NOW},${VALUES}" >> ${FILE}
@steren
steren / README.md
Last active July 17, 2016 15:24
Generate tags from a list of names

Creates an SVG image from an array of names.

Example result:

tags

How to use:

  • Add your background images into a ‘background folder’
  • Copy the code in an .html file next to this folder, and start a web server here.
@steren
steren / Color palette showcase.markdown
Created January 24, 2016 23:18
Color palette showcase
@steren
steren / Application.java
Created November 10, 2016 09:54
Stackdriver Error Reporting on Play Framework 1.4
public class Application extends Controller {
@Catch(value={Exception.class})
public static void onException(Exception ex) {
StringWriter exceptionWriter = new StringWriter();
ex.printStackTrace(new PrintWriter(exceptionWriter));
Map<String, Object> payload = new HashMap<String, Object>();
payload.put("message", exceptionWriter.toString());
Map<String,String> serviceContextData = new HashMap<String, String>();
@steren
steren / flickrdownload.html
Created January 26, 2013 00:13
Download all pictures from a flickr set. This script will list links to pictures files. You can then bulk-download them using a browser extension (Download master for Chrome, DownThemAll for Firefox...)
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
@steren
steren / index.html
Created July 2, 2017 15:42
A-frame portfolio
<!DOCTYPE html>
<html>
<head>
<title>Steren Giannini, portfolio</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
@steren
steren / regexp-optim-github.sql
Last active August 17, 2017 04:59
Look at constant Go regular expressions on GitHub and see if they match an optim
# Analyse impact of https://github.com/golang/go/issues/21463
# using BigQuery GitHub public dataset.
# To run on the entire GitHub corpus,
# remove the `sample_` prefix from the table names.
# Warning: This query processes ~2.2 TB of data, which is above BigQuery free quota.
SELECT
applies,
COUNT(*) AS cnt
@steren
steren / package.json
Last active September 21, 2017 20:46
Node.js app to generate a thumbnail of the given URL
{
"name": "web-thumbnails",
"version": "1.0.0",
"engines": {
"node": "^8.4.0"
},
"description": "Generate thumbnails of web pages",
"main": "server.js",
"scripts": {
"start": "node server.js",
@steren
steren / app.yaml
Last active May 15, 2018 00:30
Simple Node.js hello world for App Engine standard
runtime: nodejs8
@steren
steren / bunyan.js
Created June 16, 2018 06:54
Extracting trace from header and sending to Logs for correlation
const express = require('express');
const app = express();
const bunyan = require('bunyan');
const {LoggingBunyan} = require('@google-cloud/logging-bunyan');
const loggingBunyan = new LoggingBunyan();
const project = 'steren-test';