Skip to content

Instantly share code, notes, and snippets.

/*
* Setup a google sheet with api enabled. Instructions: https://www.youtube.com/watch?v=utb_wSk2j8k
* Paste the API's URL below.
* Copy and paste this gist inside contact page's <script> ... </script>
* Add the below line inside {% form %} ... {% endform %}
<input type="hidden" name="datetime" value="{{ "now" | date: "%Y-%m-%d %H:%M" }}">
*/
@niknah
niknah / google-mymaps-saving-stuck.js
Created April 11, 2023 05:44
Google My maps stuck on spinning arrow circle, not saving when editing.
// When editing google my maps and it gets stuck with the spinning arrow circle and your map has not saved. But you have kept the page with the spinner open with your unsaved info. Do not close this window.
//
// * Press F12, Go to the "console" tab. Copy and paste the below code.
// * Wait till it gets all the stuff and copy and paste the last bit into notepad.
// * Then copy and paste to google sheets or excel.
//
// Tested on 2023-04-11: If they update google my maps in the future it may not work, tell me.
//
// Problem referred to here...
// https://support.google.com/maps/thread/16395616/my-maps-not-saving-any-way-to-recover
@niknah
niknah / porkbun-domain-pricing.js
Created January 14, 2023 10:42
Get porkbun.com domain pricing in a table
// Press F12 and paste the below line...
x=[]; jQuery('.domainsPricingAllExtensionsItem').each((idx,elem) => { r=[]; jQuery('.row > div',elem).each((idx2, el2) =>{ r.push( el2.innerText.trim() ) }); x.push(r); }); x;
// Copy the result and paste into...
// https://www.convertjson.com/json-to-html-table.htm
@niknah
niknah / get_humble_bundle_trove_details.js
Last active January 18, 2022 01:36
Get OS, size details of Humble Bundle Trove games
// https://www.humblebundle.com/subscription/trove
// sort by date added first
var upto=0;
var results=[];
function getNext() {
jQuery('.dismiss-action').click();
var items=jQuery('button.trove-grid-item');
if(upto>=items.length) {
// results=results.sort(function(a,b) { return a.name.localeCompare(b.name); });
@niknah
niknah / cputemp.c
Last active February 3, 2019 01:32
This is a simple alternative to thermald. If you are not happy with thermald, try this instead.
// This software was written by Naoki Shibata in 2018. https://gist.github.com/shibatch
// No copyright is claimed, and the software is hereby placed in the public domain.
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int setFreq(double d) {
@niknah
niknah / are-you-a-human-1.4.32-invalidate-globals.patch
Created January 12, 2016 02:46
Fix problems with areyouahuman wordpress plugin, contactform.
diff -rc are-you-a-human/includes/plugin-integration/contact-form-7/ayah_cf7.php are-you-a-human.n/includes/plugin-integration/contact-form-7/ayah_cf7.php
*** are-you-a-human/includes/plugin-integration/contact-form-7/ayah_cf7.php 2015-06-17 18:16:30.000000000 +1000
--- are-you-a-human.n/includes/plugin-integration/contact-form-7/ayah_cf7.php 2016-01-12 13:04:18.694492739 +1100
***************
*** 1,6 ****
<?php
! $CF7_ERROR_MESSAGE = 'We could not verify that you are a human. Please try again.';
/**