Skip to content

Instantly share code, notes, and snippets.

View cbdelavenne's full-sized avatar

Cyrille (Asim) B. Delavenne cbdelavenne

View GitHub Profile
@cbdelavenne
cbdelavenne / httpStatusText.php
Created November 21, 2018 16:01
HTTP Status Text by Code
<?php
/**
* Get the appropriate HTTP Status Text for a given Status Code as per the IETF Status Code Registry:
* https://www.ietf.org/assignments/http-status-codes/http-status-codes.xml
*
* @param integer $code HTTP Status Code
*
* @return string HTTP Status Text
*/
@cbdelavenne
cbdelavenne / lc-diag.sh
Created June 20, 2018 19:22
LiveChat Network Diagnostics (Linux/Ubuntu)
#!/usr/bin/env bash
echo "Step 1 - Created directories to store diag results..."
mkdir -p ./lc-diag/ping
mkdir -p ./lc-diag/traceroute
mkdir -p ./lc-diag/host
echo "Step 1 - DONE!"
echo "========================"
@cbdelavenne
cbdelavenne / bokeh_plotting_sample.py
Created July 19, 2016 23:22
Sample Plotting with Bokeh
import numpy as np
from bokeh.plotting import figure, output_file, show
output_file('plotting_sample.html')
p = figure(plot_width=1200, plot_height=800)
y = np.random.uniform(low=40.0, high=120.0, size=(200,))
x = [x for x in range(0, len(y))] # Time (in Seconds)
@cbdelavenne
cbdelavenne / build-swagger-jar.sh
Created June 17, 2016 15:02
swagger-codegen-cli.jar build script
#!/bin/bash
SWAGGER_REPO="$HOME/workspace/git/swagger-codegen"
cd ${SWAGGER_REPO}
echo "Working directory: `pwd`"
echo "Executing mvn clean ..."
mvn -q clean
if [ $? -eq 0 ]; then
echo "mvn clean successful!"
@cbdelavenne
cbdelavenne / watch.sh
Created June 16, 2016 16:36
MacOS X watch script
#!/bin/bash
# usage: watch.sh <your_command> <sleep_duration>
while :;
do
clear
date
$1
sleep $2
done