convert original.pdf -colorspace gray +clone -blur 0x1 +swap -compose divide -composite -linear-stretch 5%x0% -rotate 1.5 fake-scanned.pdf
Colorscan variation:
/// Source: https://stackoverflow.com/questions/45209743/how-can-i-use-swift-s-codable-to-encode-into-a-dictionary | |
extension Encodable { | |
/// Converts an Encodable entity to it's Dictionary representation (throwable) | |
func asDictionary() throws -> [String: Any] { | |
let data = try JSONEncoder().encode(self) | |
guard let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] else { | |
throw NSError() | |
} | |
return dictionary |
// ==UserScript== | |
// @name Google Analytics color fixer | |
// @description Swaps the default blue-based palette with a proper one. Thanks to https://learnui.design/tools/data-color-picker.html for the idea & color selection | |
// @version 0.4 | |
// @author You | |
// @match https://analytics.google.com/analytics/web/*embed/report-home/*/ | |
// @match https://analytics.google.com/analytics/web/* | |
// @grant GM_addStyle | |
// ==/UserScript== |
$(document).ready(function() { | |
$.waypoints.settings.scrollThrottle = 30; | |
$('#main').waypoint(function(event, direction){ | |
/* Just as we have a sticky class applied when we hit the top waypoint, | |
we'll have a different class applied when we bottom out */ | |
if (direction === 'down') { | |
$(this).removeClass('sticky').addClass('bottomed'); | |
} | |
else { | |
$(this).removeClass('bottomed').addClass('sticky'); |
$(document).ready(function() { | |
$.waypoints.settings.scrollThrottle = 30; | |
$('#main').waypoint(function(event, direction){ | |
/* Just as we have a sticky class applied when we hit the top waypoint, | |
we'll have a different class applied when we bottom out */ | |
if (direction === 'down') { | |
$(this).removeClass('sticky').addClass('bottomed'); | |
} | |
else { | |
$(this).removeClass('bottomed').addClass('sticky'); |
class OpacityLoopAnimation | |
constructor: (options={}) -> | |
fadeInAnimation = new Animation({ | |
layer: options.layer, | |
properties: { | |
opacity: 1.00 | |
} | |
time: 1 | |
curve: Bezier.easeIn |
## Save links in a file named "links.txt" (they are extracted so you can save HTML or w/e) | |
## Run the script | |
## πππ | |
import httplib2 | |
import json | |
import string | |
import sys | |
import urllib | |
import re |
Credit goes to NSHipster: http://nshipster.com/benchmarking/
#include <stdint.h>
extern uint64_t dispatch_benchmark(size_t count, void (^block)(void));
// ==UserScript== | |
// @name WWDC unblocker for Chrome | |
// @description Allows volume control with mouse wheel // Pplay/pause with space bar // Disables auto play // Sets default volume to 20% // Double click to enter/exit fullscreen mode | |
// @version 1.0.2 | |
// @author You | |
// @match https://developer.apple.com/videos/play/* | |
// @match https://developer.apple.com/wwdc/live/* | |
// @grant none | |
// @updateURL https://gist.githubusercontent.com/bre7/e615d385e72444e1e9e9a6ded2d875b2/raw | |
// ==/UserScript== |
// ==UserScript== | |
// @name Direct Links in Google Search | |
// @namespace https://github.com/astanin | |
// @description Remove indirections from Google search results on all TLDs. | |
// @include https://www.google.tld/*output=search* | |
// @include http://www.google.tld/*output=search* | |
// @include https://www.google.tld/search* | |
// @include http://www.google.tld/search* | |
// @include https://www.google.tld/#* | |
// @include http://www.google.tld/#* |