Skip to content

Instantly share code, notes, and snippets.

@ivanteoh
ivanteoh / 28-sidebar-after.php
Created July 4, 2020 12:07
Remove WordPress List Pages from Sidebar
</li> <?php }?>
<li><h2>Archives</h2>
@ivanteoh
ivanteoh / 27-header-after.php
Created July 4, 2020 12:00
WordPress List Pages
<div id="navmenu">
<ul>
<?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
</ul>
</div>
@ivanteoh
ivanteoh / 16-header.php
Created July 4, 2020 10:24
Creating a Horizontal Menu
<div id="navmenu">
<ul>
<li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
<li><a href="blog">Blog</a></li>
<li><a href="about">About</a></li>
</ul>
</div>
@ivanteoh
ivanteoh / 13-style.css
Last active July 4, 2020 10:21
Duplicate WordPress Theme
/*
Theme Name: WordPress Default
Theme URI: http://wordpress.org/
Description: The default WordPress theme based on the famous
<a href="http://binarybonsai.com/kubrick/">Kubrick</a>.
Version: 1.6
Author: Michael Heilemann
Author URI: http://binarybonsai.com/
Kubrick v1.5
@ivanteoh
ivanteoh / flask_csrf_test_client.py
Created August 24, 2018 04:06 — forked from singingwolfboy/flask_csrf_test_client.py
Want to run your Flask tests with CSRF protections turned on, to make sure that CSRF works properly in production as well? Here's an excellent way to do it!
# Want to run your Flask tests with CSRF protections turned on, to make sure
# that CSRF works properly in production as well? Here's an excellent way
# to do it!
# First some imports. I'm assuming you're using Flask-WTF for CSRF protection.
import flask
from flask.testing import FlaskClient as BaseFlaskClient
from flask_wtf.csrf import generate_csrf
# Flask's assumptions about an incoming request don't quite match up with
@ivanteoh
ivanteoh / demodb.xml
Created May 23, 2016 03:26
Default value 0 for number field is not visible
<plominodatabase id="demodb">
<design>
<element id="formInteger" title="Integer" type="PlominoForm">
<id type="Products.Archetypes.Field.StringField">formInteger</id>
<onCreateDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onCreateDocument>
<onOpenDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onOpenDocument>
<beforeSaveDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></beforeSaveDocument>
<onSaveDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onSaveDocument>
<onDeleteDocument type="Products.Archetypes.Field.TextField"><![CDATA[]]></onDeleteDocument>
<onSearch type="Products.Archetypes.Field.TextField"><![CDATA[]]></onSearch>
{
"design": {
"formDataGrid": {
"elements": {
"order": {
"id": "order",
"params": {
"description": "",
"edit_template": "",
"field_mode": "EDITABLE",
{
"design": {
"formDate": {
"elements": {
"birthday": {
"id": "birthday",
"params": {
"description": "",
"edit_template": "",
"field_mode": "EDITABLE",
{
"design": {
"formAccordion": {
"elements": {
"cat": {
"id": "cat",
"params": {
"description": "",
"edit_template": "",
"field_mode": "EDITABLE",
{
"design": {
"formHide": {
"elements": {
"adult": {
"id": "adult",
"params": {
"description": "",
"edit_template": "",
"field_mode": "EDITABLE",