Skip to content

Instantly share code, notes, and snippets.

View joeynovak's full-sized avatar

Joey Novak joeynovak

View GitHub Profile
@joeynovak
joeynovak / gist:e14f73f0b4c1dd77c49d
Created May 8, 2015 22:07
Generate wget commands to download links on website.
jQuery('#wget').remove();
jQuery('body').append('<textarea id="wget" style="width: 100%; height: 640px"></textarea>');
jQuery('a').each(function(){
jQuery('#wget').append("wget -O " + jQuery(this).text().trim().replace(/\s+/g, '-').replace(/\\/g, '-').toLowerCase() + ".pdf http://madstyle1972.com/Repair/" + jQuery(this).attr('href') + "\n");
});
jQuery('#wget').select();
@joeynovak
joeynovak / empty-gmail-folder.php
Last active August 29, 2015 14:22
PHP To Empty a Gmail folder that has WAY too many messages...
<?php
//Change lines 6 and 7 to have your email address and password, and folder name.
//Install stunnel to use this, the default config has gmail imap already setup.
$messagesToDeleteAtOnce = 100;
$socket = fsockopen("127.0.0.1", 143);
waitForResponse($socket);
sendCommand($socket, "a login youremailaddresshere password");
sendCommand($socket, "a select foldername");
while(true){
@joeynovak
joeynovak / open-scad.xml
Created January 4, 2016 06:23
OpenSCAD NotePad++ Language Definition
<NotepadPlus>
<UserLang name="OpenSCAD" ext="scad" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">03/* 04*/ 00// 01 02</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
<?php
/*
Plugin Name: Novak Solutions Memberium De-Dupe Contact
Plugin URI:
Description: This plugin will automatically de-dupe contacts from orders when redirect to a thankyou page.
Author: Joey Novak
Version: 0.1a
Author URI: http://joeynovak.com
*/
@joeynovak
joeynovak / pic16_debugging.h
Last active June 6, 2020 00:33
Pic16 debugging by pulling RB7 Low
#define bump(x) LATB7 = 1; __delay_us(x); LATB7 = 0; __delay_us(x);
#define bumpIfBitSet(x, y) if(x){ bump(y * 2) } else { bump(y) }
TRISBbits.TRISB7 = 0;
bump(10);
bumpIfBitSet(PCONbits.STKOVF, 50);
bumpIfBitSet(PCONbits.STKUNF, 50);
bumpIfBitSet(PCONbits.nRWDT, 50);
bumpIfBitSet(PCONbits.nRMCLR, 50);
bumpIfBitSet(PCONbits.nRI, 50);
@joeynovak
joeynovak / reporting_query.sql
Created June 2, 2022 04:54
Generating a Materialized View from a key value time table.
create table
mv_simple_statistics_data_most_recent
select
subject,
`key`,
value,
previous_value,
value-previous_value as value_delta,
`date`,
previous_date,