Skip to content

Instantly share code, notes, and snippets.

View coccoinomane's full-sized avatar
🎯
Focusing

coccoinomane coccoinomane

🎯
Focusing
View GitHub Profile
@arthurattwell
arthurattwell / dialog.html
Last active August 1, 2022 09:54
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>
@JoelLisenby
JoelLisenby / vt_resize.php
Last active December 23, 2023 04:33 — forked from seedprod/vt_resize.php
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions.
* Update: Use WP_Image_Editor class instead of deprecated image_resize.
* Updated by Joel Lisenby (original function by Victor Teixeira)
*
* php 5.2+
*
* Example use:
*
@ethicka
ethicka / wp-start.sh
Last active December 27, 2023 07:10
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@ooobo
ooobo / assignEditUrls.gs
Last active June 24, 2020 12:59
put edit response urls for google form in linked spreadsheet
// install as a google script linked to the form, not the spreadsheet. must add a trigger to run assignEditUrls() on form submit.
// benefit of linking to the form is that copying the spreadsheet will copy the spreadsheet, form and script.
function assignEditUrls() {
var form = FormApp.getActiveForm();
var ss = SpreadsheetApp.openById(form.getDestinationId());
var sheet = ss.getSheets()[0];
var data = sheet.getDataRange().getValues();
var urlCol = 2; // column number where URL's should be populated; A = 1, B = 2 etc
var responses = form.getResponses();
@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)

@fabrizim
fabrizim / gravity-ajax-fix.js
Created October 14, 2015 23:37
Gravity Forms: Prevent duplicate form submission on back button
jQuery(function($){
$(document).on('gform_post_render', function(e, form_id){
$('#gform_ajax_frame_'+form_id).attr('src', 'about:blank');
});
});
@robinwarren
robinwarren / dashboard.html
Last active January 28, 2022 17:15
Trello dashboard using Bootstrap and JQuery
<html>
<head>
<title>A Trello Dashboard</title>
<link rel="stylesheet" media="screen" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Trello Dashboard</h1>
<form class="form-horizontal" id="boards_form">
@rheinardkorf
rheinardkorf / Hooks.js
Last active April 2, 2024 09:49
Simple WordPress like hooks system for JavaScript.
/**
* @file A WordPress-like hook system for JavaScript.
*
* This file demonstrates a simple hook system for JavaScript based on the hook
* system in WordPress. The purpose of this is to make your code extensible and
* allowing other developers to hook into your code with their own callbacks.
*
* There are other ways to do this, but this will feel right at home for
* WordPress developers.
*
@jaibeee
jaibeee / brew-perms.sh
Last active February 15, 2024 22:49
Configure homebrew permissions to allow multiple users on MAC OSX. Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
#!/bin/sh
# Configure homebrew permissions to allow multiple users on MAC OSX.
# Any user from the admin group will be able to manage the homebrew and cask installation on the machine.
# allow admins to manage homebrew's local install directory
chgrp -R admin /usr/local
chmod -R g+w /usr/local
# allow admins to homebrew's local cache of formulae and source files
chgrp -R admin /Library/Caches/Homebrew
@derekmartinla
derekmartinla / google-display-network-placement-analyzer
Last active December 31, 2020 09:06
Google Display Network Placement Analyzer
/***********************************************************************************************
* AdWords Account Optimization - Review Google Display Network Site Placement Quality.
* Analyze Display Network Placements that have accrued more than $20 of cost MTD against
* Standard SEO metrics (PageAuthority, DomainAuthority, # of Backlinks, Age of Site) and report back
* Any questionable placements that are strong targets for exclusion.
* Created By: Derek Martin
* DerekMartinLA.com
****************************************************************************************/
// CONSTANTS