Skip to content

Instantly share code, notes, and snippets.

View bobdenotter's full-sized avatar
🛠️
"Design is how it works, not how it looks."

Bob den Otter bobdenotter

🛠️
"Design is how it works, not how it looks."
  • Two Kings
  • The Hague, Netherlands
View GitHub Profile
@bobdenotter
bobdenotter / example.twig
Last active August 29, 2015 14:25
hackishly using SQL in Twig templates in Bolt
{% set stmt = app.db.query("SELECT id FROM bolt_pages;") %}
{% for row in stmt.fetchAll() %}
{% setcontent page = "pages" where {'id': row.id } %}
{{ dump(page) }}
<hr>
{% endfor %}
{% setcontent records = "entries/latest/6" allowpaging %}
{% for record in records %}
<h4>{{ record.title}} - {{ record.datepublish|date('Y-m-d') }} </h4>
datepublish: {{ record.datepublish|date("U") }}<br>
minus six months from now: {{ "-6 months"|date("U") }}<br>
{% if record.datepublish|date("U") < "-6 months"|date("U") %}
More than six months old.
<?php
namespace Bolt\Extension\Bolt\RSSAggregator;
/**
* RSS Aggregator Extension for Bolt
*
* @author Sebastian Klier <sebastian@sebastianklier.com>
* @author Gawain Lynch <gawain.lynch@gmail.com>
*/
@bobdenotter
bobdenotter / gist:3fd04ddc51617da76ad1
Created April 1, 2015 10:00
Method POST in bolt routing?
in routing.yml, add a route with a method:
```
fietsnieuws:
path: /fietsnieuws
method: post
defaults:
_controller: 'Bolt\Controllers\Frontend::listing'
contenttypeslug: 'nieuws'
Process: Marked 2 [2311]
Path: /Applications/Marked 2.app/Contents/MacOS/Marked 2
Identifier: com.brettterpstra.marked2
Version: 2.4.11 (895)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Marked 2 [2311]
User ID: 501
Date/Time: 2015-03-25 08:45:59.038 +0100
@bobdenotter
bobdenotter / gist:66fef18def60a25c320f
Created March 24, 2015 19:43
Sublime markdown specifix settings.
{
"color_scheme": "Packages/Theme - Afterglow/Afterglow-markdown.tmTheme",
"extensions":
[
"md"
],
"rulers":
[
70,
80,
if you have a route like `/events/{year}/{month}/{day}`, use this in your template:
{% set date = app.request.get('year') ~ '-' ~ app.request.get('month') ~ '-' ~ app.request.get('day') %}
{% setcontent events = "events" where { 'date': date } %}
{% for event in events %}
..
{% endfor %}
  • 21:08:37 silentworks: Bopp you remember what I was saying last night about the MODX community? this https://medium.com/@donaldatkinson/modx-recognizing-its-relevancy-bfeda208383f
  • 21:11:37 Bopp: "Quite simply, because MODX is the only CMS that allows anyone to make highly advanced dynamic websites with a minimal level of software development experience. "
  • 21:11:48 Bopp: silentworks: right. i see what you mean. 
  • Pinpickle [de9a6103@gateway/web/cgi-irc/kiwiirc.com/ip.222.154.97.3] entered the room. (21:11:54)
  • 21:12:18 silentworks: And this is why the Bolt community is great
  • 21:12:29 silentworks: I just hope the community will remain this way for years to come
  • 21:13:04 Bopp: Anybody that says anything with "Project X is the only [project group] that allows Y" you've instantyl made a fool of yourself
  • 21:14:13 rarila2: Bolt is the only project that allows #beer while coding
  • 21:14:14 [BoltIssueBall]: return $this->app['beer']->serve('everyone')->sendBillTo('rarila2');
  • 21:14:22 Bop
@bobdenotter
bobdenotter / gist:b256a60de8d3ff71e030
Last active August 29, 2015 14:13
Swiftmailer transport

Edit extensions/vendor/bolt/simpleforms/Extension.php, around line 740.

Replace:

$res = $this->app['mailer']->send($message);

With:

@bobdenotter
bobdenotter / .zshrc
Last active January 27, 2018 09:37
.zshrc
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="mh"
# Uncomment the following line to use case-sensitive completion.