This gist is based on this one.
// longest-request.js
var casper = require("casper").create();
var utils = require("utils");
var url = casper.cli.get(0);
var times = [];
#!/usr/bin/env perl | |
use 5.12.0; | |
use Mojo::UserAgent; | |
use Compress::Zlib; | |
my $ua = Mojo::UserAgent->new; | |
$ua->on( start => sub { | |
my ( $ua, $tx ) = @_; |
package Mojolicious::Plugin::Pipeline::CSSCompressor; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
use CSS::Compressor 'css_compress'; | |
sub register { | |
my ($self, $app) = @_; | |
# Register "css_compressor" filter | |
$app->filter(css_compressor => sub { css_compress shift }); |
package Mojolicious::Lite::MyKeywords; | |
use Mojo::Base -base; | |
use Mojo::Util 'monkey_patch'; | |
sub import { | |
my $caller = caller; | |
# Export "get_post" keyword (reuse "any" keyword to make "under" work) | |
monkey_patch $caller, 'get_post', sub { |
This gist is based on this one.
// longest-request.js
var casper = require("casper").create();
var utils = require("utils");
var url = casper.cli.get(0);
var times = [];
#!/bin/bash | |
# | |
# Copy data from a Time Machine volume mounted on a Linux box. | |
# | |
# Usage: copy-from-time-machine.sh <source> <target> | |
# | |
# source: the source directory inside a time machine backup | |
# target: the target directory in which to copy the reconstructed | |
# directory trees. Created if it does not exists. | |
# |
// | |
// Created by Adam Preble on 2/19/15. | |
// | |
/// Weak, unordered collection of objects. | |
public struct WeakSet<T where T: AnyObject, T: Hashable> { | |
typealias Element = T | |
/// Maps Element hashValues to arrays of Entry objects. | |
/// Invalid Entry instances are culled as a side effect of add() and remove() |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ffmpeg --with-x265
HTTP Live Streaming tools from https://developer.apple.com/streaming/ or https://www.dropbox.com/s/y48h70xk0nnt1vm/HTTPLiveStreamingTools368.dmg?dl=1
// An extension to replicate the same functionality from Vapor 3 with automatic content decoding: | |
import Foundation | |
import Vapor | |
/// A basic, closure-based `Responder`. | |
struct ContentBasicResponder<C: Content>: Responder { | |
/// The stored responder closure. | |
private let closure: (Request, C) throws -> EventLoopFuture<Response> | |
#!/usr/bin/env python3 | |
""" | |
This script is used to backup and restore RocksDB database instances | |
Example: | |
$ python3 backup.py backup ./my_live_db ./backup/ | |
$ python3 backup.py restore ./backup ./my_live_db | |
""" |
#! /bin/bash | |
# | |
# This is a simple bash script, designed to allow | |
# quick download and installation of the FindVUK | |
# AACS VUK database. | |
# | |
# This allows Blu-Ray disks who's VUK is known | |
# to be played on systems using libaacs. | |
# | |
# It's reccomended to schedule this file to run |