Skip to content

Instantly share code, notes, and snippets.

@lucasff
lucasff / json.ftl
Created November 15, 2021 02:49
FreeMarker FTL json
#-- The black_list contains bad hash keys. Any hash key which matches a
-- black_list entry is prevented from being displayed.
-->
<#assign black_list = [
"class",
"getclass",
"getmethod",
"getenclosingmethod",
"getcanonicalname",
"hashcode",
@lucasff
lucasff / blocklist.txt
Created April 12, 2021 18:15
The Great Suspender Malicious Domains
api.22.privacytrck.com
api.analyticlister.com
api.privacytrck.com
api.trackivation.com
api.trackized.com
cdn.coveranalytic.com
cdn.owebanalytics.com
cddn.owebanalytics.com
cdn.preanalytication.com
@lucasff
lucasff / dm-oat-milk.js
Last active October 28, 2020 14:40 — forked from marco79cgn/dm-toilet-paper.js
iOS Widget, das die Anzahl an Hafermilch in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Hafermilch Widget
//
// Original work from:
// dm Klopapier Widget
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
@lucasff
lucasff / flatten.js
Created September 18, 2019 14:54
JS flatten
const flatten = (arr, result = []) => {
if (!Array.isArray(arr)){
return [...result, arr];
}
arr.forEach((elem) => {
result = flatten(elem, result)
})
return result
}
'use strict';
/**
* @ngdoc directive
* @name ttmApp.directive:CopyHeight
* @description
* Set the height of an element base on another element
*/
angular.module('ttmApp')
@lucasff
lucasff / dumpoverssh.sh
Created October 10, 2015 18:32 — forked from kirkegaard/dumpoverssh.sh
pipe a mysql dump through gzip and send it over ssh
mysqldump -u MYSQL_USERNAME -p YOUR_DATABASE | gzip -c | ssh USERNAME@YOUR_TO_HOST 'cat > ~/dump.sql.gz'
@lucasff
lucasff / javascript.js
Created October 12, 2014 06:43
Riddle Animate
var parent, ink, d, x, y;
$(".riddle-animate").click(function(e){
parent = $(this).parent();
//create .ink element if it doesn't exist
if(parent.find(".ink").length == 0)
parent.prepend("<span class='ink'></span>");
ink = parent.find(".ink");
//incase of quick double clicks stop the previous animation
ink.removeClass("animate");
@lucasff
lucasff / index.html
Created August 27, 2014 21:57
Welcome page ISPConfig
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="/favicon.ico" />
<meta name="robots" content="noindex" />
<style type="text/css"><!--
@lucasff
lucasff / .htaccess
Created August 27, 2014 19:10
monster .htaccess
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache
# config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@lucasff
lucasff / db-error.php
Last active August 29, 2015 14:05
Perishable Press WordPress database error
<?php // custom WordPress database error page tutorial @ digwp.com
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600'); // 1 hour = 3600 seconds
mail("spamless@domain.tld", "Database Error", "There is a problem with teh database!", "From: Montgomery Scott");
?>
<!DOCTYPE HTML>
<html dir="ltr" lang="en-US">