Skip to content

Instantly share code, notes, and snippets.

View janit's full-sized avatar

Jani Tarvainen janit

View GitHub Profile
@janit
janit / Layouts
Last active August 29, 2015 14:11
system:
default:
user:
layout: eZDemoBundle::pagelayout.html.twig
login_template: eZDemoBundle:Security:login.html.twig
location_view:
full:
mainsite_frontpage:
controller: "EzFinlandMainSiteBundle:Demo:showBlogPost"
@janit
janit / gist:32a36c5a1dcbbf6bca5d
Created June 22, 2015 20:26
Example H2O HTTP server configuration for PHP rewrite apps (such as Bolt, WordPress)
# to find out the configuration commands, run: h2o --help
user: www-data
hosts:
"example.com":
listen:
host: xx.xx.xx.xx
port: 443
@janit
janit / gist:39e28e153ed95f68ab9e
Created June 24, 2015 09:23
Hits to symfony.fi ([22/Jun/2015:17:42:59 +0200] to [24/Jun/2015:11:17:31 +0200])
cat /var/log/h2o/access-log | wc -l
18070
cat /var/log/h2o/access-log | grep "HTTP/1" | wc -l
4782
cat /var/log/h2o/access-log | grep "HTTP/2" | wc -l
13288
@janit
janit / gist:9da68428d0c13fee1bc1
Last active August 29, 2015 14:23
Hits to symfony.fi - comparing number of HTTP/2 vs. HTTP/1x requests
Log from: [22/Jun/2015:17:42:59 +0200] - [24/Jun/2015:11:17:31 +0200]
cat /var/log/h2o/access-log | wc -l
18070
cat /var/log/h2o/access-log | grep "HTTP/1" | wc -l
4782
cat /var/log/h2o/access-log | grep "HTTP/2" | wc -l
13288
<script src="js/tags/ymap.tag" type="riot/tag"></script>
<script src="https://cdn.jsdelivr.net/g/riot@2.0.14(riot.min.js+compiler.min.js)"></script>
<script src="http://api-maps.yandex.ru/2.0-stable/?load=package.full&lang=en-US" type="text/javascript"></script>
<script>
riot.mount('*');
</script>
<ymap zoom="5" center="0,40"></ymap>
<ymap>
<div id="ymap{{ opts.mapid }}"></div>
<style scoped>
div {
width: 320px;
height: 240px;
}
</style>
@janit
janit / index.html
Last active August 29, 2015 14:24
Riot.js Yandex Map Component
<!doctype html>
<html>
<head>
<title>Riot.js Yandex Map Component</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.5/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script>html5.addElements('ymap')</script>
# Settings for caching in parts of Bolt.
# - config: Caches the parsed .yml files from /app/config. It's updated
# immediately when one of the files changes on disk. There
# should be no good reason to turn this off.
# - templates: Caches rendered templates.
# - request: Caches entire rendered pages like '/page/about', but only on
# GET requests.
# - duration: The duration (in minutes) for the 'templates' and 'request'
# options. default is 10 minutes. Note that the duration is set
# on storing the cache. By lowering this value you will not
@janit
janit / app.php
Created September 13, 2015 10:37
Twigriot 1
$twig->addExtension(new Janit\Twig\RiotRendererExtension());
class RiotRendererExtension extends \Twig_Extension
{
public function getName() {
return "riot_render";
}
public function getFunctions() {
return array(
'riot_render' => new \Twig_Function_Method($this, 'riotRenderer',
array('is_safe' => array('html'))
)