Skip to content

Instantly share code, notes, and snippets.

View coccoinomane's full-sized avatar
🎯
Focusing

coccoinomane coccoinomane

🎯
Focusing
View GitHub Profile
@coccoinomane
coccoinomane / request.php
Last active June 6, 2016 13:53
Print to screen and save to file the most important global PHP variables: _POST, _GET, _SERVER, _FILES, _REQUEST.
<?php
/**
* Print to screen and save to file the most important global PHP
* variables: _POST, _GET, _SERVER, _FILES, _REQUEST.
*
* As an alternative, consider also the free service http://requestb.in/.
*
* Created by Guido W. Pettinari on 06/06/2016.
* Latest version: https://gist.github.com/2eae82be7d5b4c35dbfd73fcf5c7eefb
*/
@coccoinomane
coccoinomane / mailup_form_submission.js
Last active November 26, 2019 19:37
MailUp subscription via Javascript
/**
* Subscribe user in MailUp upon form completion, using MailUp
* HTTP API.
*
* To hook into the form submission we use button click rather than
* actual submission, because the latter approach (using $('form').submit)
* does not seem to work.
*
* The MailUp API specifications can be found here:
* http://help.mailup.com/display/mailupapi/HTTP+API+Specifications
<?php
/**
* Disable all Dashboard Widgets.
*
* Inspired by https://digwp.com/2014/02/disable-default-dashboard-widgets/.
*
* Created on 30/4/2016 by Guido W. Pettinari
* Latest version: https://gist.github.com/b10f4d0bf50b8f359b52d0bc50203650
*/
@coccoinomane
coccoinomane / get_duplicates.php
Created April 18, 2016 17:19
PHP script to find duplicates & unique entries among two separate files
<?php
/**
* PHP script to find duplicates & unique entries among two
* separate files.
*
* The script outputs one file with the matching lines and
* one with the unique ones.
*
* Example:
<?php
/*
#########################################################
---------------------------------------------------------
-- Fix tabindex in Gravity forms
---------------------------------------------------------
#########################################################
*/
<?
/**
* Class to get the share counts from the major social networks.
*
* Thanks to the user Sunny from 99webtools!
* http://99webtools.com/blog/php-script-to-get-social-share-count/
*
* Execute this script to test the class on the URL in the variable
* $url.
Login string: http://webmail.mydomain.com/CardDAV
CONNECTION OK
<?xml version="1.0"?>
<D:multistatus xmlns:B="urn:ietf:params:xml:ns:carddav" xmlns:D="DAV:" xmlns:S="http://calendarserver.org/ns/">
<D:response>
<D:href>/CardDAV/</D:href>
<D:propstat>
<D:prop>
<D:supported-report-set>
#!/usr/bin/env php
<?php
/**
* Script to convert input files from vGroup format to vCard
* format.
*
* The output files will have the .csv extensions appended;
* a backup of each existing output file will be created with
#!/usr/bin/env php
<?php
/**
* List all folders in an IMAP account, together with
* number of unread messages and number of total messages
* in each folder.
*
* In order to work, this script requires the presence of a
@coccoinomane
coccoinomane / Excel Password Generator.md
Last active May 1, 2024 00:47
Copy this formula into an Excel cell to generate a random 9-character password

Copy this formula into an Excel cell to generate a random 9-character password. Then Copy & Paste Special (as value) in place in order to avoid the cell being continuosly re-evaluated. Formula taken from: http://ficility.net/2013/04/26/easy-excel-based-password-generator/.

English version

=CHAR(RANDBETWEEN(65;90))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(65;90))&RANDBETWEEN(1000;9999)&CHAR(RANDBETWEEN(42;43))

English version (with commas)