Skip to content

Instantly share code, notes, and snippets.

View nfcg's full-sized avatar
🏠
Working from home

Nuno Carmo nfcg

🏠
Working from home
View GitHub Profile
@nfcg
nfcg / pushbullet_sms.php
Created January 16, 2022 19:36
Pushbullet Send SMS
<?php
$mobile_token = "o.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
$mobile_iden = "xxxxxxxxxxxxxxxxxxxxxxx";
function sendSMS($to, $message)
{
global $mobile_iden, $mobile_token;
$to = "+351" . $to;
$data = [
"data" => [
<?php
function sqlite($method, $cmd)
{
global $database, $values;
try {
if (!file_exists($database)){throw new PDOException("database not found");}
$db = new PDO("sqlite:$database");
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->exec("PRAGMA journal_mode = wal;");
@nfcg
nfcg / php_array_to_xml.php
Last active May 26, 2022 15:50
php array to xml
<?php
function arrayToXML($array, SimpleXMLElement $xml, $child_name)
{
foreach ($array as $k => $v) {
if(is_array($v)) {
(is_int($k)) ? arrayToXML($v, $xml->addChild($child_name), $v) : $this->arrayToXML($v, $xml->addChild(strtolower($k)), $child_name);
} else {
(is_int($k)) ? $xml->addChild($child_name, $v) : $xml->addChild(strtolower($k), $v);
}
}
@nfcg
nfcg / nif.class.php
Created January 21, 2024 22:45 — forked from iznog/nif.class.php
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;
@nfcg
nfcg / DICOFRE_SQLite_3_dump.sql
Created February 18, 2024 22:18
DICOFRE SQLite 3 dump
-- DICOFRE SQLite 3 dump
DROP VIEW IF EXISTS "CO";
CREATE TABLE "CO" ("CONCELHO" text, "DICOFRE_CO" );
DROP VIEW IF EXISTS "COFRE";
CREATE TABLE "COFRE" ("CONCELHO" text, "FREGUESIA" text, "DICOFRE_CO" , "DICOFRE_FRE" );
DROP VIEW IF EXISTS "DI";
CREATE TABLE "DI" ("DISTRITO" text, "DICOFRE_DI" );
@nfcg
nfcg / Hackback
Last active March 8, 2025 22:35 — forked from denji/Hackback
Nikto, NMap , Skipfish and friends http://www.security-marathon.be/?p=844
_ _ _ ____ _ _
| | | | __ _ ___| | __ | __ ) __ _ ___| | _| |
| |_| |/ _` |/ __| |/ / | _ \ / _` |/ __| |/ / |
| _ | (_| | (__| < | |_) | (_| | (__| <|_|
|_| |_|\__,_|\___|_|\_\ |____/ \__,_|\___|_|\_(_)
A DIY Guide for those without the patience to wait for whistleblowers
--[ 1 ]-- Introduction
[
{
"name": "Aruba",
"name_pt": "Aruba",
"iso": "AW",
"cc": "+297"
},
{
"name": "Islamic Republic of Afghanistan",
"name_pt": "República Islâmica do Afeganistão",