Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View graphicagenda's full-sized avatar
🥳
Just upgraded to GIt Pro

Shining Bright Diamond graphicagenda

🥳
Just upgraded to GIt Pro
View GitHub Profile
@graphicagenda
graphicagenda / hb_all_books_dl.js
Created November 17, 2020 20:00 — forked from barrywoolgar/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript.
This will download all the books in all the formats available.
*/
$('a').each(function(i){
if (['MOBI', 'PDF', 'EPUB'].indexOf($.trim($(this).text())) >= 0) {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
@graphicagenda
graphicagenda / window-height-width.js
Last active November 29, 2019 22:54 — forked from joshcarr/window-height-width.js
[vanilla JS window width and height] #unlabeled
// vanilla JS window width and height
var w=window,
d=document,
e=d.documentElement,
g=d.getElementsByTagName('body')[0],
x=w.innerWidth||e.clientWidth||g.clientWidth,
y=w.innerHeight||e.clientHeight||g.clientHeight;
@graphicagenda
graphicagenda / wp-bootstrap4.1-pagination.php
Last active November 29, 2019 22:53 — forked from mtx-z/wp-bootstrap4.4-pagination.php
[Wordpress Bootstrap 4.1 pagination (with custom WP_Query() and global $wp_query support)] #unlabeled
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
*
* @return string
* Accepts a WP_Query instance to build pagination (for custom wp_query()),
* or nothing to use the current global $wp_query (eg: taxonomy term page)
* - Tested on WP 4.9.5
@graphicagenda
graphicagenda / bootstrap-pagination.php
Last active November 29, 2019 22:53 — forked from ediamin/bootstrap-pagination.php
[Bootstrap Pagination for WordPress] #WordPress #Bootstrap #unlabeled
/*
* custom pagination with bootstrap .pagination class
* source: http://www.ordinarycoder.com/paginate_links-class-ul-li-bootstrap/
*/
function bootstrap_pagination( $echo = true ) {
global $wp_query;
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
@graphicagenda
graphicagenda / import_json_appsscript.js
Last active November 29, 2019 22:44 — forked from paulgambill/import_json_appsscript.js
[Import JSON Apps Script] #unlabeled
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@graphicagenda
graphicagenda / humble_bundle_file_downloader.js
Last active November 29, 2019 22:44 — forked from tlc/humble_bundle_file_downloader.js
[Download HumbleBundle book bundles easier.] Puts 'curl' statements on the page for you to copy. #unlabeled
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
@graphicagenda
graphicagenda / _html_entities.scss
Last active November 29, 2019 22:43 — forked from apisandipas/_html_entities.scss
[HTML Entities map] The pseudo-element 'content' property doesnt accept normal (&raquo;) style HTML entities. These variables below easy the pain of looking up the HEX codes... #LegacyGISTS #starred
/**
* The pseudo-element 'content' property doesnt accept normal (&raquo;) style
* HTML entities. These variables below easy the pain of looking up the HEX codes...
*
* Referenced from http://www.danshort.com/HTMLentities/
*
* TODO: Add all the other entities? Worth it? Some day? Maybe?
*/
// Punctuation
@graphicagenda
graphicagenda / jQuery HTML5 placeholder fix.js
Last active November 29, 2019 22:40 — forked from hagenburger/jQuery HTML5 placeholder fix.js
[jQuery HTML5 placeholder fix] #LegacyGISTS
// @via https://gist.github.com/hagenburger/379601
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
@graphicagenda
graphicagenda / imagesQueue.js
Last active November 29, 2019 22:39 — forked from kamui/imagesQueue.js
[imagesQueue.js] #LegacyGISTS
/*
imagesQueue.js FULL SOURCE
A simple, cross-browser, *parallel* images loader object.
Check http://labs.lieldulev.com/imagesQueue/ for more details.
*/
imagesQ={
onComplete: function(){} // Fires when all finished loading
,onLoaded: function(){} // Fires when an image finishes loading
,onErrored: function(){} // Fires when an image fails to load
,current: null // Last loaded image (Image Object)
@graphicagenda
graphicagenda / jQuery HTML5 placeholder fix.js
Last active November 29, 2019 22:39 — forked from hagenburger/jQuery HTML5 placeholder fix.js
[jQuery HTML5 placeholder fix.js] #LegacyGISTS #jQuery
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);