Skip to content

Instantly share code, notes, and snippets.

@cemerson
cemerson / archive.org-scanned-book-downloader-bookmarklet.md
Last active May 4, 2024 04:35
Archive.org Scanned Book Downloader Bookmarklet

Archive.org Scanned Book Downloader Bookmarklet

A simple "1-click" javascript approach to downloading a scanned book from archive.org to read at your leisure on the device of your choosing w/out having to manually screenshot every pages of the book by hand. In short it's a glorified "Save Image As..." approach but consolidated down to "1 click". BTW there may be a much better option than this out there - I just built this as an autistic project to see if it would work.

Demo Video

Archive.org SBDL Demo

Obligatory Legal/Disclaimer:

By using this script you agree to delete all book files/images after your 1 hour or 14 days is up! I don't support using this script for any other use cases. After all, none of us have ever kept a library book past it's return date, right?

@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active April 26, 2024 10:15
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@DaniSancas
DaniSancas / neo4j_cypher_cheatsheet.md
Created June 14, 2016 23:52
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@brixen
brixen / shim.rb
Last active August 29, 2015 14:25
How to properly define a common interface across Ruby versions, engines and engine versions
# The goal is to define a common set of methods independent of Ruby version
# engine, and engine version to make other code more simple. The problem is:
# 1. the method may not be defined for the advertised Ruby version
# 2. the method may be defined but "shouldn't" be for that version
# 3. the method may not be defined and shouldn't be defined
# The conditional needs to account for these cases. If the method is not
# defined but should be for that Ruby version, that should be a hard error.
# If the method is defined but shouldn't be for that Ruby version, it may
# not be a compatible definition and that should be checked early rather
# than resulting in a confusing error later. Finally, if it's not defined
@lrytz
lrytz / z-automator.png
Last active February 4, 2023 21:20
Shortcut for Syntax Highlighting in Keynote
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
@lukaszx0
lukaszx0 / view_classes_proposal.md
Last active December 21, 2015 06:59
View Classes implementation proposal
@dafyddcrosby
dafyddcrosby / gist:4408779
Last active April 2, 2018 12:30
List of packages to install to run Steam on Fedora 17 64-bit (note - you will need to install the rpmfusion repos)
mesa-dri-filesystem.i686
libgcc.i686
glibc.i686
nss-softokn-freebl.i686
zlib.i686
libstdc++.i686
freetype.i686
nspr.i686
libogg.i686
libjpeg-turbo.i686
@andyferra
andyferra / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@drogus
drogus / Gemfile
Created April 23, 2012 18:34
Webmachine + ActionView pt2
source "http://rubygems.org"
gem "webmachine"
gem "actionpack"
gem "thin"
gem "datamapper"
gem "dm-migrations"
gem "dm-sqlite-adapter"
gem "debugger"