An introduction to curl using GitHub's API
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 |
viewport_width = $(window).width() | |
ideal_height = parseInt($(window).height() / 2) | |
summed_width = photos.reduce ((sum, p) -> sum += p.get('aspect_ratio') * ideal_height), 0 | |
rows = Math.round(summed_width / viewport_width) | |
if rows < 1 | |
# (2a) Fallback to just standard size | |
photos.each (photo) -> photo.view.resize parseInt(ideal_height * photo.get('aspect_ratio')), ideal_height | |
else | |
# (2b) Distribute photos over rows using the aspect ratio as weight |
## 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 |
#!/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]}} |
#!/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> |
<!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, |
license: gpl-3.0 |