This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use 5.010; | |
use vars qw($VERSION); | |
use strict; | |
use warnings; | |
use Getopt::Long qw(GetOptions); | |
Getopt::Long::Configure qw(gnu_getopt); | |
use Cwd 'abs_path'; | |
use File::Basename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This function takes an array of denominations for a currency and a sum, and returns an array describing the most efficient way to express the sum in terms of denominations. | |
// E.g. A sum, such as 200 EUR can be expressed in terms of 100x2, which is inefficient, as there is the denomination 200 for this job. | |
// The function will return the most efficient way to express the sum, not 100x2, but 200x1. | |
// Recommended to round both, the expected and actual value to 2 decimal places. | |
// FUNCTION | |
// getChange function | |
function getChange($sum, $denominations) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// AUTHOR: algb12 | |
// An implementation of the Pascal's triangle in PHP | |
// It is relatively fast, even with values in the 100s and 1000s | |
function pascalRow($n) | |
{ | |
// Every Pascal's triangle starts with a 1 | |
$row = [1]; | |
// If row number ($n) is 0, just return an array with 1 in it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Real-time UDP IP Geolocator | |
printf "### REAL-TIME UDP IP GEOLOCATOR ###\n" | |
printf "===================================\n" | |
# Query user options | |
read -p "Please enter the interface on which to listen for connections (Default: Detection by script): " interface | |
read -p "Please enter the minimum packet size which should trigger a frame recording (Default: 200): " minPackLen | |
read -p "Please enter the UDP port number on which to listen for connections (Default: Detection by script (follow instructions later on in config!)): " port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" id="tnp-subscription-ajax"> | |
// Wait for jQuery to load | |
jQuery(document).ready(function($) { | |
// Identify form through submit button | |
var form = $('.tnp-submit').parent().closest('form'); | |
// This is the syntax to target the form associated with the submit button (keeps form validation) | |
form.submit(function(e) { | |
// Only trigger if it's the subscribe form, and not any other type of form | |
if (form.attr('action').endsWith("?na=s")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Poetizer File-System (PFS) | |
# Receiver | |
# | |
# LICENSE: Public Domain | |
# AUTHOR: Anonymous | |
# | |
# NOTE: Do not take this seriously please, | |
# it's just a little fun project by a web-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/python | |
# POM terms finder for Google Ads campaigns - v1.0 | |
# Python 3.5+ | |
# Make sure to install PyWebCopy and BeautifulSoup before using this tool, like so: | |
# pip install pywebcopy bs4 | |
from bs4 import BeautifulSoup | |
from glob import glob | |
import os |