Skip to content

Instantly share code, notes, and snippets.

Magnus Bonnevier magnusbonnevier

Block or report user

Report or block magnusbonnevier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@magnusbonnevier
magnusbonnevier / mb_twitter_pornbot_blocklist_2018-09-24.csv
Last active Sep 24, 2018
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.
View mb_twitter_pornbot_blocklist_2018-09-24.csv
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
@magnusbonnevier
magnusbonnevier / EyeKeyValueStore.php
Last active May 18, 2017
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.
View EyeKeyValueStore.php
<?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 / pw_add_page_via_api_example_none_verbose.php
Last active Sep 19, 2016
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.
View pw_add_page_via_api_example_none_verbose.php
<?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 / pw_add_page_via_api_example.php
Last active Sep 19, 2016
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.
View pw_add_page_via_api_example.php
<?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 / INSERT
Last active Aug 29, 2015
PHP PDO reference gists. Mainly for my own use but anyone is welcome to fork and use it.
View INSERT
<?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';
View eyeGrid_topbar_v1.0.css
/*
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 / eyeGrid_v1.0.css
Created Oct 29, 2014
eyeGrid v1.0 - Simple Easy 12 column CSS grid
View eyeGrid_v1.0.css
/*
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.
View examples_file_vanilla_accordion.html
<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.
You can’t perform that action at this time.