Skip to content

Instantly share code, notes, and snippets.

View muiton's full-sized avatar
😅
Listen trap beat 😁

Muito muiton

😅
Listen trap beat 😁
View GitHub Profile
@muiton
muiton / cryptor.php
Created May 8, 2019 21:53 — forked from petermuller71/cryptor.php
cryptor : PHP Encryption and decryption based on libsodium (standard lib >php7.2)
<?php
print "<h1>PHP Encryption with libsodium</h1>";
$message = "This text is secret";
$ciphertext = cryptor::encrypt("password", $message);
$plaintext = cryptor::decrypt("password", $ciphertext);
print "Message:<br />$message <br /><br />Ciphertext:<br />$ciphertext<br /><br />Plaintext:<br />$plaintext";
@muiton
muiton / plugin-filter.php
Created April 19, 2019 09:36 — forked from carlodaniele/plugin-filter.php
A Must-use plugin to filter active plugins in on a per-page basis.
<?php
/**
* @package active-plugins
* @version 1.0
*
* Plugin Name: Active Plugins
* Plugin URI: http://wordpress.org/extend/plugins/#
* Description: This is a development plugin
* Author: Carlo Daniele
* Version: 1.0
@muiton
muiton / ChromeAppDownloader.py
Created April 12, 2019 16:26 — forked from arulrajnet/ChromeAppDownloader.py
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
# -*- coding: utf-8 -*-
"""
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
Referred from http://chrome-extension-downloader.com/how-does-it-work.php
"""
from __future__ import division
import argparse
import requests
@muiton
muiton / phone_extract.txt
Created March 13, 2019 02:27 — forked from maguay/phone_extract.txt
Regex to find phone phone numbers in all standard and international formats
(?:(?:\+?([1-9]|[0-9][0-9]|[0-9][0-9][0-9])\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([0-9][1-9]|[0-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?
/a tweaked version of the second regex in the question here to allow for all country codes and leading zeros in area codes: https://stackoverflow.com/questions/3868753/find-phone-numbers-in-python-script
print('Interest Calculator:')
amount = float(input('Principal amount ?'))
roi = float(input('Rate of Interest ?'))
years = int(input('Duration (no. of years) ?'))
total = (amount * pow(1 + (roi/100), years))
interest = total - amount
print('\nInterest = %0.2f' %interest)