Skip to content

Instantly share code, notes, and snippets.

View smlb's full-sized avatar

Simone Lombardi smlb

View GitHub Profile
@smlb
smlb / lastsync.pl
Created February 4, 2014 22:10
Modified version of lastsync.pl for Arch (I use it with conky)
#!/usr/bin/perl
use Date::Manip;
$date = `grep "pacman -Syu" /var/log/pacman.log | tail -n1 | cut -c 2- | cut -c-16`;
$date = &DateCalc("Jan 1, 1970 00:00:00 GMT",$date);
$date = UnixDate("$date","%A %H:%M");
print "$date";
@smlb
smlb / LICENSE
Last active August 29, 2015 13:56
Little experiments using subprocess with i3wm
The MIT License (MIT)
Copyright (c) 2014 Simone Lombardi
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@smlb
smlb / userChrome.css
Last active April 19, 2016 17:38
userChrome.css for Firefox, modified version of this -> http://twily.info/firefox/firefox-css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Firefox CSS for Nightly/Australis by Twily
** REQUIRES FIREFOX NIGHTLY v29 AND UP
*/
:root {
/* VARIABLES */
var-bg-light: #424242; var-bg-dark: #000000;
var-fg-light: #ffffff; var-fg-dark: #ffffff;
@smlb
smlb / userChrome.css
Created March 12, 2014 22:47
Hide url and search bar in firefox, add this in ~/.mozilla/firefox/<profile>/chrome/
#nav-bar { display: none !important; }
@smlb
smlb / .vimperatorrc
Created May 13, 2014 14:12
.vimperatorrc: nothing special, sono few config
set gui=nonavigation
set cpt=l
set visualbell
set noerrorbells
set hintchars=abcdefghijklmnopqrstuvwxyz
map <Right> gt
map <Left> gT
map <C-s> /
colorscheme molokai
@smlb
smlb / config.h
Created May 18, 2014 21:26
My simple config.h for dwm (you need gap patch)
/* appearance */
static const char font[] = "-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*";
static const char normbordercolor[] = "#444444";
static const char normbgcolor[] = "#151515";
static const char normfgcolor[] = "#aaaaaa";
static const char selbordercolor[] = "#151515";
static const char selbgcolor[] = "#151515";
static const char selfgcolor[] = "#ff8c00";
static const unsigned int gappx = 2;
static const unsigned int borderpx = 1; /* border pixel of windows */
@smlb
smlb / gmail.sh
Created May 22, 2014 09:54
Get email from gmail
USER=your_username
PASS=your_passwd
COUNT=`curl -su $USER:$PASS https://mail.google.com/mail/feed/atom || echo "<fullcount>unknown number of</fullcount>"`
COUNT=`echo "$COUNT" | grep "<fullcount>" | sed -e s/"<fullcount>"// -e s/"<\/fullcount>"//`
echo $COUNT
if [ "$COUNT" != "0" ]; then
if [ "$COUNT" = "1" ];then
WORD="mail";
else
@smlb
smlb / arch_birthday.sh
Created June 20, 2014 14:36
Arch Birthday
sed -n '1s/^\[\([0-9-]*\).*$/\1/p' /var/log/pacman.log | tr - .
@smlb
smlb / batt.sh
Last active September 8, 2017 17:37
Battery notify
BATT=`acpi -b | awk '{ split($5,a,":"); print substr($3,0,2), $4, "["a[1]":"a[2]"]" }' | tr -d ',' | awk '{print $2}' | sed 's/\%//g'`
@smlb
smlb / strtok.c
Last active July 20, 2017 12:39
strtok.c
char* strtok(char* str, const char* delim) {
static char* s = NULL;
char* tok;
if(str == NULL) {
if(s == NULL)
return NULL;
} else
s = str;
for(size_t i; (*s != '\0'); s++) {
for(i = 0; (delim[i] != '\0') && (*s != delim[i]); i++);