Skip to content

Instantly share code, notes, and snippets.

View coccoinomane's full-sized avatar
🎯
Focusing

coccoinomane coccoinomane

🎯
Focusing
View GitHub Profile
<!-- #!/usr/bin/env php -->
<!-- ^ Uncomment to launch from shell -->
<?php
/**
* Script to count the number of files in a directory and in
* all its subdirectories.
*
* The function returns an array with two entries: the total number
/**
* Javascript for use with Universal Google Analytics (GA) that tracks the
* scrolling actions performed by the user of a website.
*
* This script is a version of the fantastic Advanced Content Tracking script
* by Justin Cutroni, slightly modified by Guido Pettinari to include extra
* documentation and adjust some parameters (see doc below). The original script
* can be found at http://cutroni.com/blog/2014/02/12/advanced-content-tracking-
* with-universal-analytics/, while the latest version of this script can be
* found at https://gist.github.com/a1c715e2a448da2dfd69.
<?php
/**
* Script (PHP & Javascript) to send category information from Wordpress
* to Universal Google Analytics (GA).
*
* The Wordpress category is passed using the Content Grouping feature of
* GA, to the contentGroup1 group.
*
* If the function is_product() is defined, the script assumes the website
#!/bin/sh
#
# Git hook script to remove the annoying Icon? files created
# by Google Drive.
n_icon_files=`find . -name Icon? | grep -c /`
if [ $n_icon_files != "0" ]; then
echo "Will delete $n_icon_files files 'Icon?' generated by Google Drive\n"
find . -name Icon? -exec rm -f {} \;
fi
@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)

#!/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
#!/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
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>
<?
/**
* 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.
<?php
/*
#########################################################
---------------------------------------------------------
-- Fix tabindex in Gravity forms
---------------------------------------------------------
#########################################################
*/