Skip to content

Instantly share code, notes, and snippets.

View martijngastkemper's full-sized avatar

Martijn Gastkemper martijngastkemper

View GitHub Profile
@martijngastkemper
martijngastkemper / prezi-fullscreen.html
Created October 9, 2015 08:00
Show a fullscreen embed Prezi presentation.
<html>
<head>
<title>Prezi presentation</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" type="text/css" rel="stylesheet" />
</head>
<body>
<iframe id="iframe_container" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="100%" height="100%" src="https://prezi.com/embed/ujk4bs8b72ki/?bgcolor=ffffff&amp;lock_to_path=0&amp;autoplay=0&amp;autohide_ctrls=0&amp;landing_data=bHVZZmNaNDBIWkRDVE93YVVDTVN5dWF2eDNlZVpKayszYlFONi91ZVhLUVdLQ1RaUnZTZ04yVTR0YjM0dXlWbnhYZ3F6WU09&amp;landing_sign=vw8A4a6gflkN-MHQ1jTdQ95uragP8fklEo-qfhXCYwQ"></iframe>
</body>
</html>
<?php
/*
Plugin Name: Sub Categories Widget
Description: This Widget lists the sub-categories for a given category.
Author: BrokenCrust
Version: 1.4.1
Author URI: http://brokencrust.com/
Plugin URI: http://brokencrust.com/plugins/sub-categories-widget/
License: GPLv2 or later
Text Domain: sub-categories-widget
@martijngastkemper
martijngastkemper / nginx.conf
Created June 5, 2015 09:47
Some LUA testing in Nginx
location /test {
content_by_lua '
if ngx.var.arg_name == nil then
ngx.say("name: missing")
else
ngx.say("name: [", ngx.var.arg_name, "]")
end
';
}
@martijngastkemper
martijngastkemper / reset_password.sql
Created June 2, 2015 09:20
Reset user password.
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
@martijngastkemper
martijngastkemper / config
Last active August 29, 2015 14:20
Easily access server via "$ ssh server"
# ~/.ssh/config
Host server
Hostname myserver.com
User my-long-name
Port 1234567
@martijngastkemper
martijngastkemper / nginx_app.conf.php
Created April 17, 2015 12:08
Use this Nginx configuration to properly run Symfony in production (online) and development (local) environments on Heroku.
location / {
# try to serve file directly, fallback to rewrite
try_files $uri @rewriteapp;
}
location @rewriteapp {
# rewrite all to app.php
rewrite ^(.*)$ /app<?php echo getenv('SYMFONY_ENV') === 'prod' ? '' : '_dev'; ?>.php/$1 last;
}
@martijngastkemper
martijngastkemper / timestamp.tpl
Last active August 29, 2015 14:18
Smarty timestamp example
Default date format: {$date|date_format}
Timestamp: {$date|date_format:"%s"}
{if $date|date_format:"%s" < $smarty.now}
True
{else}
False
{/if}
SetEnvIfNoCase Request_URI ^/protected-page-1 require_auth
SetEnvIfNoCase Request_URI ^/protected-page-2 require_auth
AuthName "Login"
AuthUserFile path/to/.htpasswd
AuthType Basic
Order Deny,Allow
Deny from all
Satisfy any
SELECT u.url, min(time), avg(time), max(time), count(*), VAR_POP(time) , STD(time)
FROM data d LEFT JOIN url u ON u.id = d.url
WHERE `timestamp` > TIMESTAMP(NOW() - INTERVAL 1 DAY)
GROUP BY d.url
#!/bin/bash
#$ -V
#$ -j yes
set NHOSTS manually here:
export NHOSTS=2
NPART=$NHOSTS
#
# This script starts a single-domain Delft3D-FLOW computation on Linux in parallel mode
# asuming nodes are allocated manually