Skip to content

Instantly share code, notes, and snippets.

View klashxx's full-sized avatar
💭
I may be slow to respond.

Juan Diego Godoy Robles klashxx

💭
I may be slow to respond.
View GitHub Profile
@klashxx
klashxx / curl.md
Created August 2, 2016 15:40 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
declare -a loggers
declare -A fileConfig
declare -A streamConfig
declare -A LEVELS=(["DEBUG"]=10 ["INFO"]=20 ["WARNING"]=30
["ERROR"]=40 ["CRITICAL"]=50)
readonly LEVELS
function log {
declare -a comp
@klashxx
klashxx / Linux Static IP
Created September 4, 2016 09:04 — forked from fernandoaleman/Linux Static IP
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@klashxx
klashxx / parse_yaml.sh
Created September 5, 2016 12:33 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@klashxx
klashxx / linux.sh
Created January 9, 2017 01:38 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <[email protected]>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
import itertools
import pandas as pd
from shapely.geometry import Polygon
from shapely.geometry.multipolygon import MultiPolygon
umbral = 0.8
list_poligonos = []
df = pd.read_csv('polygons15.csv', names=['x1', 'y1', 'x2', 'y2', 'x3', 'y3', 'x4', 'y4', 'umbral', 'd'] )
<!DOCTYPE html>
<html>
<head>
<title>CSS Horizontal Traffic Light</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
</head>
@klashxx
klashxx / live-update-chartjs.html
Created April 29, 2017 13:08 — forked from geoff-parsons/live-update-chartjs.html
Example of live updating Chart.js charts.
<!DOCTYPE html>
<html>
<head>
<title>Chart.js Redraw Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="chart.min.js"></script>
<script type="text/javascript" charset="utf-8">
window.chartOptions = {
segmentShowStroke: false,
@klashxx
klashxx / .block
Created April 29, 2017 14:12 — forked from mbostock/.block
Line Transition
license: gpl-3.0