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
@jph00
jph00 / py.md
Last active May 31, 2022 06:16
Organized and hyperlinked index to every module, function, and class in the Python standard library

All of the python 3.9 standard library

For a version without the collapsible details sections (so you can search the whole thing in your browser), click here.

@mtx-z
mtx-z / wp-bootstrap4.4-pagination.php
Last active April 4, 2023 12:55
Wordpress 5.4 Bootstrap 4.4 pagination (with custom WP_Query() and global $wp_query support) (UPDATED for Bootstrap 5: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* UPDATE for Bootstrap 5.0: https://gist.github.com/mtx-z/af85d3abd4c19a84a9713e69956e1507
*
@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 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())) {
@AO8
AO8 / isbn_lookup.py
Last active April 7, 2024 13:20
A simple ISBN lookup that uses Python and the Google Books API to display basic information about a book.
import urllib.request
import json
import textwrap
while True:
base_api_link = "https://www.googleapis.com/books/v1/volumes?q=isbn:"
user_input = input("Enter ISBN: ").strip()
with urllib.request.urlopen(base_api_link + user_input) as f:
@barrywoolgar
barrywoolgar / hb_all_books_dl.js
Created September 2, 2016 11:06 — forked from graymouser/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');
}
@carlodaniele
carlodaniele / custom_menu_admin.php
Last active May 26, 2022 20:32
A basic plugin showing how to add menu metaboxes to admin menu page
<?php
/**
* @package Custom_menu_admin
* @version 1.0
*/
/*
Plugin Name: Custom menu admin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@ediamin
ediamin / bootstrap-pagination.php
Created July 5, 2015 21:10
Bootstrap Pagination for WordPress
/*
* 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(
@einfallstoll
einfallstoll / README.md
Created June 30, 2015 13:30
Reset Spotlight Location (Fix for OS X 10.11 El Capitan)

Installation for GUI Users

  1. Right click the file and choose information and choose to always open this file with Terminal.app

  2. Go to the Terminal.app and do something like this chmod 744 Reset Spotlight.sh

  3. There you go, you can now double click it so reset the Spotlight location

  4. Optional: Uncomment line for the useCount to prevent Spotlight to forget that you already used it

@erineland
erineland / exportsafarireadinglist.sh
Last active January 19, 2020 00:58
Export Safari's Reading List to Pocket/Evernote (or any service with an "email content in" feature)
#!/bin/bash
# Script to export Safari's reading list into a text file, then import this into Pocket or Evernote (or any service with a "email in content" feature).
# First take all of Safari's Reading List items and place them in a text file.
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g' > readinglistlinksfromsafari.txt
# Now loop over each of those URls within that text file and add them to pocket.
while IFS= read -r line
do
echo $line
@joshcarr
joshcarr / window-height-width.js
Created July 3, 2014 00:04
vanilla JS window width and height
// 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;