Skip to content

Instantly share code, notes, and snippets.

View ldante86's full-sized avatar

Luciano Dante Cecere ldante86

View GitHub Profile
@ldante86
ldante86 / lcal.css
Created November 9, 2016 02:34
minified css for lcal
body{background:gray}
table{background:#000;border:2px solid #000}
table.center{margin-left:auto;margin-right:auto}
.month{font-size:50px;word-spacing:.5em;color:#FFF;font-weight:700}
td{font-family:Arial;text-align:center;font-size:25px;width:82px;height:82px;padding:0;font-weight:700}
.weekbar{height:10px;background:#232323;color:#FFF}
.sunday{background-color:#606060;color:#FFF;font-style:italic}
.weekday{background-color:silver}
.today{background-color:red;font-size:35px;color:#FFF}
.today:hover{background-color:#000;color:red}
@ldante86
ldante86 / temp.sh
Last active November 9, 2016 04:28
get temperature by metar station name
#!/bin/bash
if [ "$1" ]; then
declare -u metar="$1"
curl -s http://tgftp.nws.noaa.gov/weather/current/${metar}.html | \
grep -A 5 Temperature | grep "F ([0-9]" | awk -F ">" '{print $3}' | sed 's/(.*//' | sed 's/^ *//'
fi
@ldante86
ldante86 / htag.sh
Last active November 9, 2016 05:47
html version of btags.sh
#!/bin/bash -
if [ ! "$1" ]; then
exit 1
fi
in_file="$1"
if [ ! -e "$in_file" ] || [ -d "$in_file" ]; then
exit 1
@ldante86
ldante86 / karma.sh
Created November 9, 2016 06:30
get reddit karma numbers for user
#!/bin/bash -
reddit_user="$1"
echo
echo "karma for /u/${reddit_user}"
echo
page=$(lynx -source "https://www.reddit.com/user/${reddit_user}/")
@ldante86
ldante86 / redditcli.sh
Created November 9, 2016 21:36
some command line functions for reddit
#!/bin/bash -
PROGRAM="${0##*/}"
REDDIT_URL="https://www.reddit.com/"
USAGE="
$PROGRAM -flag parameter
-h | --help show this help and exit
@ldante86
ldante86 / dim.sh
Created November 14, 2016 19:40
Dim the screen with xbacklight using 1, 2, 3 buttons.
#!/bin/bash -
# Dim the screen with xbacklight using 1, 2, 3 buttons.
dim()
{
local prog=/usr/bin/xbacklight
local step=20 state
which $prog >/dev/null
@ldante86
ldante86 / mkpr.sh
Last active November 16, 2016 15:51
Create new shell project
#!/bin/bash -
# SCRIPT: mkpr
# AUTHOR: Luciano D. Cecere
# YEAR: 2016
# PURPOSE: This script creates a new shell project with common directories and files included.
# USAGE: mkpr project-name version
# NOTE: If a version number is not specified, 0.0.1 is used by default.
PROGRAM="${0##*/}"
@ldante86
ldante86 / markdown.nanorc
Created November 16, 2016 04:54
markdown syntax highlighting for nano
## Here is an example for markdown.
##
syntax "markdown" "\.(md|MD)$"
color brightred "#*"
color white "^\* "
color red "\*\*"
@ldante86
ldante86 / exnote.sh
Created November 16, 2016 06:14
decimal to exponential notation
#!/bin/bash -
#
# SCRIPT: exnote
# AUTHOR: Luciano D. Cecere
########################################################################
#
# exnote - convert signed decimals and integers to exponential notation
# Copyright (C) 2015 Luciano D. Cecere <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
@ldante86
ldante86 / hexnote.sh
Created November 16, 2016 06:15
convert decimal to hexadecimal
#!/bin/bash -
#
# SCRIPT: hexnote
# AUTHOR: Luciano D. Cecere
########################################################################
#
# hexnote - convert base 10 integers to hexadecimal notation
# Copyright (C) 2015 Luciano D. Cecere <[email protected]>
#
# This program is free software: you can redistribute it and/or modify