Skip to content

Instantly share code, notes, and snippets.

View magnusbonnevier's full-sized avatar

Magnus Bonnevier magnusbonnevier

View GitHub Profile
@magnusbonnevier
magnusbonnevier / eyeGrid_v1.0.css
Created October 29, 2014 10:13
eyeGrid v1.0 - Simple Easy 12 column CSS grid
/*
eyeGrid v1.0 - Simple Easy 12 column CSS grid
based on percentages.
Author: Magnus Bonnevier
www.magnusbonnevier.se
This grids purpose is to be simple and easy to
customize for your own use. A boilerplate.
A base to build on. It´s not ment to be the encompasing solution.
@magnusbonnevier
magnusbonnevier / eyeGrid_topbar_v1.0.css
Created October 29, 2014 10:16
eyeGrid - topbar v1.0
/*
eyeGrid topbar v1.0 component
Usefull to add a simple topbar.
load after the 'eyeGrid_1.0.css' file.
*/
.eyeGrid-topbar-container {
position: relative;
display: block;
@magnusbonnevier
magnusbonnevier / INSERT
Last active August 29, 2015 14:19
PHP PDO reference gists. Mainly for my own use but anyone is welcome to fork and use it.
<?php
/*
Example copied from:
http://php.net/manual/en/pdo.prepared-statements.php
I altered it slightly to my taste of coding.
*/
// insert one row of data contained in these vars
$name = 'one';
@magnusbonnevier
magnusbonnevier / examples_file_vanilla_accordion.html
Created March 13, 2012 23:04
Vanilla Accordion - jQuery plugin
<script type="text/javascript">
/*
NOTE:
This is only an example of how to call the plugin.
Not a ready-to-go example.
Create a test config object to pass to our plugin.
we set the startOpen setting to null so no div is
open at start.
@magnusbonnevier
magnusbonnevier / pw_add_page_via_api_example.php
Last active September 19, 2016 12:16
This is a simple code example on how to add a Page or sub Page in ProcessWire via the API on the fly in your PHP template file.
<?PHP
/* some random strings and stuff for testing */
$randTitle = 'test_' . mt_rand(0, 1000000);
$randHash = 'test_' . md5(mt_rand(0, 100000) + time());
/*
Example: Creating a new sub page to a parent page via API
Author: Magnus Bonnevier
This example do not check if the page name allready exist it
@magnusbonnevier
magnusbonnevier / pw_add_page_via_api_example_none_verbose.php
Last active September 19, 2016 12:35
a less verbose example on how to add a Page or sub Page to a parent via the ProcessWire API on the fly in your PHP template file.
<?PHP
/* some random strings and stuff for testing */
$randTitle = 'test_' . mt_rand(0, 1000000);
$randHash = 'test_' . md5(mt_rand(0, 100000) + time());
/*
Shorter less verbose example of how to add a page
or sub page via ProcessWire API to a parent
*/
@magnusbonnevier
magnusbonnevier / EyeKeyValueStore.php
Last active May 18, 2017 10:50
Simple PHP class that handles a simple key value store, It uses flat textfiles for this. You can store values of string, Array, Objects. Etc.
<?PHP
namespace EyeDentify\Tools;
class EyeKeyValueStore {
/*
EyeKeyValueStore class v1.1
author: Magnus Bonnevier.
e-mail: magnus.bonnevier@gmail.com
website: www.magnusbonnevier.se
@magnusbonnevier
magnusbonnevier / mb_twitter_pornbot_blocklist_2018-09-24.csv
Last active September 24, 2018 08:46
Curated CSV block list of porn bots and the like that i block on my twitter account. Updated often. I check all my submissions to the list. This is mostly for my use, but if you have have use for it all the better. Your welcome to suggest twitter account ID:s for porn bots. See ya.
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
No entries