{{ message }}

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Shining Bright Diamond graphicagenda

💭
I may be slow to respond.
Created Nov 17, 2020 — forked from barrywoolgar/hb_all_books_dl.js
View hb_all_books_dl.js
 /* 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('
Created Oct 24, 2020
View humble-bundle-home.py
 from collections import namedtuple from bs4 import BeautifulSoup as Soup import requests import json from datetime import datetime, timedelta import webbrowser from collections import Counter HB = 'https://www.humblebundle.com' CONTENT = requests.get(HB).text
Created Oct 4, 2020
Code Wars Kata: Numbers in Expanded Form
View kata-module.py
 # https://www.codewars.com/kata/5842df8ccbd22792a4000245/train/python def expanded_form(num): num = list(str(num)) store = [] for i in range(len(num)): x = int(num[i]) if x > 0: store.append(str(int(x * ( 10 ** (len(num) - int(i) - 1)) ))) return ' + '.join(store)
Created Sep 4, 2020
Output a chart of crypto value and percent change in the last 1h, 24h, 7d
View echocryptonumbers.sh
 function echocryptonumbers { printf ' %-5s: %21s %7s %10s %9s\n' "COIN" "CURRENT VALUE" "1H" "24H" "7D" # echo -e "Coin : Current Value 1h 24h 7d" curl -s -H 'X-CMC_PRO_API_KEY: {CMC_PRO_API_KEY}' \ -H 'Accept: application/json' \ -d 'symbol=BTC,ETH,LTC' \ -G https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest | \ jq -r '.data | .[] | .symbol, .quote.USD.price, .quote.USD.percent_change_1h, .quote.USD.percent_change_24h, .quote.USD.percent_change_7d' | \ while read -r SYMBOL; do read -r PRICE
Created Aug 24, 2020
Using your CMC api token, retrieve the symbol and price for selected tokens
View cryptonumbers.sh
 function cryptonumbers { curl -H 'X-CMC_PRO_API_KEY: {CMC_PRO_API_KEY}' \ -H 'Accept: application/json' \ -d 'symbol=BTC,ETH,LTC' \ -G https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest | \ jq -r '.data | .[] | .symbol, .quote.USD.price' | \ while read -r SYMBOL; do read -r PRICE echo -e "\${SYMBOL} - \\$\${PRICE}" done
Last active Nov 29, 2019 — forked from joshcarr/window-height-width.js
[vanilla JS window width and height] #unlabeled
View window-height-width.js
 // 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;
Last active Nov 29, 2019 — forked from mtx-z/wp-bootstrap4.4-pagination.php
[Wordpress Bootstrap 4.1 pagination (with custom WP_Query() and global \$wp_query support)] #unlabeled
Last active Nov 29, 2019 — forked from ediamin/bootstrap-pagination.php
[Bootstrap Pagination for WordPress] #WordPress #Bootstrap #unlabeled
View bootstrap-pagination.php
 /* * 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(
Last active Nov 29, 2019 — forked from paulgambill/import_json_appsscript.js
[Import JSON Apps Script] #unlabeled
View import_json_appsscript.js
 /** * 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();