Skip to content

Instantly share code, notes, and snippets.

View verticalgrain's full-sized avatar

Jamie Graham verticalgrain

View GitHub Profile
@rvagg
rvagg / README.md
Last active August 7, 2024 22:05
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@jbutko
jbutko / script.js
Last active October 2, 2019 08:14
jQuery: JQuery smooth scrolling when clicking an anchor link
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
// http://stackoverflow.com/questions/7717527/jquery-smooth-scrolling-when-clicking-an-anchor-link/7717572#7717572?newreg=16ca424bc4024b21a4fcc728ea6451d5
@mandiwise
mandiwise / Limit Gravity Forms Upload Size
Last active January 16, 2022 14:12
Set a maximum upload size for a Gravity Forms image field
function limit_file_upload_size( $validation_result ) {
$form = $validation_result['form'];
foreach( $form['fields'] as &$field ){
// NOTE: Add a custom CSS class to your image upload field and grab onto it here...
if( strpos( $field['cssClass'], 'choose-file' ) === false )
continue;
@mannieschumpert
mannieschumpert / gist:e5cec8723247f9490016
Created October 9, 2014 21:01
Remove Gravity Forms' "Add Form" button from all WYSIWYG editors
<?php
add_filter( 'gform_display_add_form_button', function(){return false;} );
@stvhwrd
stvhwrd / website-dl.md
Last active November 6, 2024 15:50
Download an entire website for offline use with wget. Internal inks will be corrected so that the entire downloaded site will work as it did online.

The best way to download a website for offline use, using wget

There are two ways - the first way is just one command run plainly in front of you; the second one runs in the background and in a different instance so you can get out of your ssh session and it will continue.

First make a folder to download the websites to and begin your downloading: (note if downloading www.SOME_WEBSITE.com, you will get a folder like this: /websitedl/www.SOME_WEBSITE.com/)


STEP 1:

@NamPNQ
NamPNQ / bitcoin-cpuminer.sh
Last active August 22, 2018 03:11 — forked from return1/bitcoin-cpuminer.sh
install a bitcoin cpuminer on ubuntu/debian
# install dependencies
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git gcc -y
# clone cpuminer
git clone https://github.com/pooler/cpuminer.git
# compile
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3"
@georgestephanis
georgestephanis / myhacks.php
Created February 3, 2016 23:58
This is a tester for wp rest api authentication. You can call against unsecured and it'll always work, but change to secured and it'll only work for authed admins.
<?php
add_action( 'rest_api_init', 'myhacks_init' );
function myhacks_init() {
register_rest_route( 'myhacks', '/unsecured', array(
'methods' => 'GET',
'callback' => 'myhacks_response',
) );
@d2s
d2s / installing-node-with-nvm.md
Last active October 20, 2024 13:06
Installing Node.js to Linux & macOS & WSL with nvm

Installing Node.js with nvm to Linux & macOS & WSL

A quick guide on how to setup Node.js development environment.

Install nvm for managing Node.js versions

nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.

  1. Open new Terminal window.
gulp.task('css-browsersync', function() {
return gulp.src(["*.scss"])
.pipe(sass().on('error', function(err) {
console.error(err.message);
browserSync.notify(err.message, 3000); // Display error in the browser
this.emit('end'); // Prevent gulp from catching the error and exiting the watch process
}))
.pipe(gulp.dest("public/"))
.pipe(browserSync.stream());
});
@gbaman
gbaman / HowToOTGFast.md
Last active October 31, 2024 23:33
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i