Skip to content

Instantly share code, notes, and snippets.

View iznog's full-sized avatar

Paulo Cruz iznog

View GitHub Profile
@iznog
iznog / sscan-clean.sh
Created December 15, 2017 15:01
Simple-scan - Cleaning user temp directories after segmentation fault
#!/bin/bash
# When there's segmentation fault on start of simple-scan
# kill simple-scan
kill `pidof simple-scan`
# delete temp files
rm ~/.cache/simple-scan/autosaves/*
rm ~/.cache/simple-scan/state
@iznog
iznog / converte.sh
Created November 16, 2017 11:05
converting project code from iso8859-1 to utf8
#!/bin/sh
for i in $(ls -lh *.php | awk -F " " '{print $9}')
do
iconv -t utf8 -f iso-8859-1 $i -o $i.utf8
done
cd auth
for i in $(ls -lh *.php | awk -F " " '{print $9}')
do
@iznog
iznog / nif.class.php
Last active January 21, 2024 22:45
Portuguese NIF Validation
<?php
class Nif{
function calcularNif($string_nif){
if(strlen($string_nif)==9){
$nif_temp=str_split($string_nif);
//print_r($nif_temp);
//echo "<br>";
$contador=9;
$soma_controlo=0;