Skip to content

Instantly share code, notes, and snippets.

View marcolussetti's full-sized avatar

Marco Lussetti marcolussetti

View GitHub Profile
@marcolussetti
marcolussetti / manjaro.sh
Last active September 27, 2016 01:18
Manjaro useful commands
#System update
pacman -Syu #full upgrade of pacman packages
yaourt -Syu --devel --aur #full upgrade of aur packages installed with yaourt
#Package management
pacman -S package #Installs package
pacman -Ss package #Finds package
pacman -Sy #Updates package list
pacman -Qa #List packages installed from AUR
yaourt -S package #Installs AUR package
@marcolussetti
marcolussetti / runallclasses.bat
Last active September 27, 2016 01:18
Workaround for DrJava autoimport issue: runs all compiled java classes in the current directory
@echo off
for %%f in (%cd%\*.class) do (
echo #### Running %%~nf ####
java %%~nf
echo.
echo.)
set /p end="Press anything to exit!"
@marcolussetti
marcolussetti / gist:bedf3cb6f5de2b7f83a9c3abeaee6ddc
Created November 11, 2016 06:01 — forked from yhara/gist:1408888
GitHub Emoji (sort by category)
emotion :+1: :-1: :clap: :heart: :sparkles: :v: :zzz:
icon :new: :ok: :cool: :vs: :tm: :warning: :wheelchair: :zap: :art: :bomb: :bulb: :key: :lock: :memo: :mag:
item :book: :gift: :moneybag: :mega: :scissors: :hammer:
device :computer: :iphone: :calling: :email:
human :cop: :runner: :feet: :fist: :punch: :lipstick: :tophat:
food :beer: :cake: :smoking:
behicle :airplane: :bike: :bus: :ski: :taxi: :train:
animal :bear: :fish: :octocat:
nature :fire: :leaves: :star: :sunny:
@marcolussetti
marcolussetti / wikimedia-equivalent-domains-lastpass.txt
Created February 26, 2017 22:44
Wikimedia Equivalent Domains for LastPass
wikipedia.org,wiktionary.org,wikibooks.org,wikinews.org,wikiquote.org,wikisource.org,wikiversity.org,wikivoyage.org,wikimedia.org,mediawiki.org,wikidata.org
@marcolussetti
marcolussetti / gist:9b9cf190490867658f495652829b60fc
Last active February 28, 2017 23:28
Print lots of source code files to pdf
# to ~/.bashrc
#src2pdf
src2pdf () {
local noext="${1%.*}"
pygmentize -O full -o "$noext.html" "$1"
# enabling line wrapping in <pre> blocks
perl -i -wpe '/<style.*>$/&&($_.="pre{white-space:pre-wrap;}\n")' "$noext.html"
wkhtmltopdf -s letter "$noext.html" "$noext.pdf"
rm "$noext.html"
@marcolussetti
marcolussetti / PKGBUILD
Last active March 4, 2017 23:48
Downgrading Android Studio to 2.2.3 on Arch Linux
# Maintainer: danyf90 <daniele.formichelli@gmail.com>
# Contributor: Philipp 'TamCore' B. <philipp [at] tamcore [dot] eu>
# Contributor: Jakub Schmidtke <sjakub-at-gmail-dot-com>
# Contributor: Christoph Brill <egore911-at-gmail-dot-com>
# Contributor: Lubomir 'Kuci' Kucera <kuci24-at-gmail-dot-com>
# Contributor: Tad Fisher <tadfisher at gmail dot com>
pkgname=android-studio
pkgver=2.2.3.0
pkgrel=1
@marcolussetti
marcolussetti / mytru-cli.py
Last active June 18, 2017 00:24
MyTRU CLI client - WORK IN PROGRESS
#!/usr/bin/python3
import re
from datetime import datetime, timezone, timedelta
from bs4 import BeautifulSoup
import requests
# **** CONFIGURATION PARAMS ****
mytru_username = "" # MyTRU username
mytru_password = "" # MyTRU password
@marcolussetti
marcolussetti / mail.sh
Created June 18, 2017 17:32
Pipe mail from mytru-cli.py
#!/bin/bash
input="${@:1}"
if echo "${@:1}" | grep ","; then
curl -s --user 'api:key-WHATEVER' \
https://api.mailgun.net/v3/DOMAIN_NAME/messages \
-F from='Transcript Bot <mailgun@DOMAIN_NAME>' \
-F to='RECEIVER' \
-F subject='Change in Transcript Marks for Current Session' \
-F text="$input"
fi
@marcolussetti
marcolussetti / loop.sh
Last active June 18, 2017 19:33
Looper once hourly to check for new grades
!/bin/bash
mytru_output="$(./mytru-cli.py)"
until echo "$mytru_output" | grep ",";
do
echo "$(date)"
sleep 1h
mytru_output="$(./mytru-cli.py)"
done
echo "$mytru_output" | xargs sh mail.sh
@marcolussetti
marcolussetti / playerinfo.py
Last active July 12, 2017 18:43
NFL Player Info using nfldb
#!/usr/bin/env python2.7
# Queries nfldb for the team & position of a player
import nfldb
import sys
db = nfldb.connect()
q = nfldb.Query(db)
if len(sys.argv) < 2:
argument = raw_input("Enter player name: ")
else: