Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import os
import sys
while True:
try:
filename = raw_input()
except EOFError:
sys.exit(0)
try:
@fragmede
fragmede / gist:8782876
Created February 3, 2014 12:16
count used c files
#!/usr/bin/env python
import os
headers = 0
c_asm = 0
mf = 0
mod_c = 0
dir_hash = {}
def countlines(filename):
@fragmede
fragmede / restart-ff.sh
Created May 11, 2013 18:33
FVDWLR - Firefox Virtual Desktop Window Location Restore-er Simple shell script to restore firefox window locations to their previous virtual desktop location.
#!/bin/bash
# FVDWLR - Firefox Virtual Desktop Window Location Restore-er
#
#When Firefox restarts (crash/whatever), when the previous browsing session is restored, the virtual desktop that the window was running on is not also restored. If you're like me, and categorize browsing by windows and virtual desktops this is very annoying. (ie I have a Firefox window researching matlab on the same desktop that matlab is running on, and then on a different desktop I have Gmail/barnowl/irssi running.) This failure to restore desktops is thus quite annoying.
#
#This simple shell script fixes that by restarting Firefox within the shell script. It uses xprop and wmctrl to read and restore the virtual desktop location of windows after (forcibly) restarting Firefox.
#Note that I'm on Debian and so 'Firefox' is technically Iceweasel, so change the variable as needed
#Requires x11-utils and wmctrl packages:
# sudo apt-get install x11-utils wmctrl
#