Skip to content

Instantly share code, notes, and snippets.

View 7rin0's full-sized avatar

SEVERINO, Luis 7rin0

  • Lyon, France
View GitHub Profile
@7rin0
7rin0 / print_progress.py
Created January 30, 2019 09:55 — forked from aubricus/License
Python Progress Bar
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
@7rin0
7rin0 / arduino_accelerometer_gyroscope_payload.json
Last active October 24, 2018 10:32
arduino_accelerometer_gyroscope_payload.json
[
{
"sp":"bluetooth",
"spn":"ble_demo_hc06",
"sf":"20",
"smn":[
{
"name":"accelerometer_gyroscope",
"data":[
{
@7rin0
7rin0 / cakephp2.conf
Created July 26, 2018 17:17 — forked from pasela/cakephp2.conf
nginx configuration example for CakePHP 2.x
#
# nginx configuration example for CakePHP 2.x
#
server {
listen 80;
server_name cakephp2.example;
root /var/www/cakephp2/app/webroot;
access_log /var/log/nginx/cakephp2.access.log;
error_log /var/log/nginx/cakephp2.error.log;
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@7rin0
7rin0 / ca.md
Created July 12, 2018 15:01 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@7rin0
7rin0 / test_parse_yaml_file.sh
Last active August 20, 2021 09:29
Parse yaml file using php cli and yaml mod
# Requirements: php, php-yaml (pecl extention)
php -r 'echo print_r(yaml_parse_file(__DIR__ . "/app/config/parameters.yml"), 1);'
@7rin0
7rin0 / rm_last_revisions.sh
Last active June 28, 2018 15:19
Shell > Keep the last 3 revisions
# oneline
RELEASE_NB=$(ls -tdr -- */ | cut -d'/' -f1 | wc -w) && RELEASE_NB_DIFF=$(echo $RELEASE_NB-3 | bc) && if test $RELEASE_NB > 3 ; then rm -rf $(ls -tdr -- */ | head -$RELEASE_NB_DIFF | cut -d'/' -f1) ; fi
@7rin0
7rin0 / apache2_vhost_config_vuejs_dist
Created June 18, 2018 13:50
VueJS: Apache / Nginx vhost config examples
<VirtualHost *:80>
DocumentRoot "/home/dev/server/project/dist/"
ServerName vuejs.project.local
<Directory /home/dev/server/project/dist/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require all granted
Order allow,deny
allow from all
@7rin0
7rin0 / auto_update.md
Created March 1, 2018 22:02 — forked from lifuzu/auto_update.md
Android auto update apk implementation
public class UpdateApp extends AsyncTask<String,Void,Void>{
private Context context;
public void setContext(Context contextf){
    context = contextf;
}

@Override
protected Void doInBackground(String... arg0) {
      try {
@7rin0
7rin0 / nginx.conf
Created February 28, 2018 10:45 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which