Skip to content

Instantly share code, notes, and snippets.

Started GET "/" for 10.10.10.1 at 2015-11-16 13:04:28 +0000
Processing by GeneralController#frontpage as */*
Xapian query (0.00022s) Search: variety:response (status:successful OR status:partially_successful)
InfoRequestEvent Load (0.5ms) SELECT "info_request_events".* FROM "info_request_events" WHERE (info_request_events.id in ('908','906','913'))
InfoRequest Load (0.4ms) SELECT "info_requests".* FROM "info_requests" WHERE "info_requests"."id" IN (105, 106, 108)
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" IN (1, 5)
PublicBody Load (0.4ms) SELECT "public_bodies".* FROM "public_bodies" WHERE "public_bodies"."id" IN (3, 5, 6)
CensorRule Load (0.3ms) SELECT "censor_rules".* FROM "censor_rules" WHERE "censor_rules"."info_request_id" IN (105, 106, 108) ORDER BY created_at desc
Xapian query (0.00016s) Search: variety:sent
InfoRequestEvent Load (0.4ms) SELECT "info_request_events".* FROM "info_request_events" WHERE (info_request_events.id in ('916','904'))
@zarino
zarino / gist:e72f0abc64849e8b11d9
Created January 5, 2016 10:51
Carousel proof of concept
<!-- Progressively enhances a load of slides, so they can be flicked through like a carousel -->
<!-- Assumes only one .js-slide per page, and jQuery available -->
<!-- Untested! -->
<style>
.js-slide { display: none }
.js-slide:first-child { display: block }
</style>
<div class="js-slides">
@zarino
zarino / pseudolocalize.js
Last active February 20, 2016 16:15
A simple JavaScript function that doubles every character on a web page – useful when testing layouts for i18n issues
// Paste this function to your browser’s JavaScript console,
// and then run it, passing in a CSS selector, eg:
// > pseudolocalize('body')
var pseudolocalize = function pseudolocalize(arg){
if(typeof arg === 'string'){
var elements = document.querySelectorAll(arg);
for(var i=0, len=elements.length; i<len; i++){
pseudolocalize(elements[i]);
}
@zarino
zarino / set_video_metadata_date_created.sh
Created January 3, 2018 21:13
Automatically alter the “date added” for a video file in the Synology Video Station database, to match the last modification date of the file on disk
#!/bin/sh
set -e
if [ -z "$1" ]; then
cat <<'EOF'
Usage:
./set_video_metadata_date_created.sh '/absolute/path/to/video/file.mp4'