Skip to content

Instantly share code, notes, and snippets.

View indiependente's full-sized avatar
:octocat:
Building stuff in Go

Francesco Farina indiependente

:octocat:
Building stuff in Go
View GitHub Profile
@indiependente
indiependente / pdfscan.sh
Created September 26, 2022 17:40
PDF Scan effect
convert -density 130 input.pdf -rotate 0.2 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
{
"Working Directory" : "\/Users\/francescofarina",
"Prompt Before Closing 2" : 0,
"Selected Text Color" : {
"Red Component" : 0.8402875065803528,
"Color Space" : "Calibrated",
"Blue Component" : 0.8971381187438965,
"Alpha Component" : 1,
"Green Component" : 0.8579363226890564
},

Keybase proof

I hereby claim:

  • I am indiependente on github.
  • I am indiependente (https://keybase.io/indiependente) on keybase.
  • I have a public key ASCHq2kkcWFwyaMGOtGIvEMHmz74zgF9cN5T7feHh8p3Bwo

To claim this, I am signing this object:

@indiependente
indiependente / mandelbrot.py
Created May 12, 2015 12:24
Generate a Mandelbrot Fractal image
_ = (
255,
lambda
V ,B,c
:c and Y(V*V+B,B, c
-1)if(abs(V)<6)else
( 2+c-4*abs(V)**-0.4)/i
) ;v, x=1500,1000;C=range(v*x
);import struct;P=struct.pack;M,\
j ='<QIIHHHH',open('M.bmp','wb').write
@indiependente
indiependente / addlrc.py
Last active August 29, 2015 14:20 — forked from scturtle/addlrc.py
import eyed3
import re
import glob
def get_lyric(lrc):
text = open(lrc).read()
text = re.sub(r'(?:\[.*\])+', '', text).strip()
text = map(lambda l: l.strip(), text.split('\n'))
ans = []
for l in text:
@indiependente
indiependente / difftime.py
Created July 15, 2014 17:08
Returns the total, partial form start and partial to end time difference
#!/usr/bin/python
from datetime import datetime
def difftime(start, middle, end):
dateStart = datetime.strptime(start, '%y/%m/%d %H:%M:%S')
dateMiddle = datetime.strptime(middle, '%y/%m/%d %H:%M:%S')
dateEnd = datetime.strptime(end, '%y/%m/%d %H:%M:%S')
total = dateEnd - dateStart
@indiependente
indiependente / toCSV.sh
Created July 15, 2014 10:26
TSV to CSV
#!/bin/bash
n=$1 #number of files
file=$2 #common starting filename
mkdir csv
for i in $(seq 1 $n)
do
cat $file$i | awk '{ print $1","$2","$6","$8 }' > ./csv/$file$i.csv
done
#!/bin/sh
known_windows=$(xwininfo -root -children|sed -e 's/^ *//'|grep -E "^0x"|awk '{ print $1 }')
for id in ${known_windows}
do
xwd -out $id.xwd -id $id -display :0.0
done
@indiependente
indiependente / extended_cool.lex
Created June 21, 2014 08:53
Cool Lexer with extended keywords recognition
/*
* The scanner definition for COOL.
*/
import java_cup.runtime.Symbol;
%%
/* Input character */
InputCharacter = [^\r\n]
@indiependente
indiependente / extended_cool.cup
Created June 21, 2014 08:51
Cool parser with extended constructs
/*
* cool.cup
* Parser definition for the COOL language.
*
*/
import java_cup.runtime.*;
import java.util.*;
/* Stuff enclosed in {: :} is copied verbatim to the class containing