Skip to content

Instantly share code, notes, and snippets.

🐢
Turtling

Pär Thernström bonny

🐢
Turtling
Block or report user

Report or block bonny

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
View södermalm.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View keybase.md

Keybase proof

I hereby claim:

  • I am bonny on github.
  • I am eskapism (https://keybase.io/eskapism) on keybase.
  • I have a public key ASAcBveAKwwwqxEhr3J7LhlB6sp2CiOVxdG6to9eWVgCWQo

To claim this, I am signing this object:

@bonny
bonny / simple-history-log-http-requests-time.php
Created May 6, 2016
Snippet for WordPress plugin Simple History Log that logs https request made and how long each request took
View simple-history-log-http-requests-time.php
<?php
/**
* To use this you first need to install the free plugin Simple History
* https://wordpress.org/plugins/simple-history/
*/
// pre_http_request is fired close before the actual request
add_filter( 'pre_http_request', function( $retval, $r, $url ) {
@bonny
bonny / simple-history-to-slack-incoming-webhook-integration.php
Created Feb 5, 2016
Example how to post all logged events in WordPress recent events plugin Simple History to Slack
View simple-history-to-slack-incoming-webhook-integration.php
<?php
// Prio 100 so we run late and give other filters chance to run
add_filter( "simple_history/log_insert_context", "on_log_insert_context_slackit", 100, 2 );
function on_log_insert_context_slackit( $context, $data ) {
$slack_webhook_url = '<your incoming webhook url>';
$remote_addr = empty( $context["_server_remote_addr"] ) ? "" : $context["_server_remote_addr"];
View Gistdeck test
name: inverse
layout: true
class: middle, inverse
---
## Detta är en presentation
Diggar man markdown är detta ett väldigt enkelt sätt att skapa presentationer på serru.
- Använder markdown
View ntunnel_mysql.php
<?php //version my202
//set allowTestMenu to false to disable System/Server test page
$allowTestMenu = true;
header("Content-Type: text/plain; charset=x-user-defined");
error_reporting(0);
set_time_limit(0);
function phpversion_int()
View test.js
alert(123);
document.write(456);
@bonny
bonny / test.css
Last active Aug 29, 2015
css test
View test.css
body {
background: red;
}
body:after {
content: "css changed";
position: absolute;
top: 20px;
left: 20px;
@bonny
bonny / simple-note-osx-app-restorer.php
Last active Jul 24, 2017
PHP script to list and retrieve notes from the OS X Simple Notes app. Nice to have since import/sync seems buggy in first version of the app (It deleted two months of notes for me anyway, because of a crash during import.) How to: Find the file "Simplenote.storedata.xml" that is located perhaps here or in your time machine or Arq or similar: ~/L…
View simple-note-osx-app-restorer.php
<meta charset="utf-8">
<title>SimpleNote Restorer</title>
<style>
body {
font-family: sans-serif;
background-color: #f5f5f5;
color: #111;
font-size: 14px;
}
li {
@bonny
bonny / simple_fields-set-post-connector-with-code.php
Last active May 9, 2016
Simple Fields examples: - how to hide post connector drop down on edit post screen using PHP - how to select post connector for a post using PHP
View simple_fields-set-post-connector-with-code.php
<?php
/**
* Set post connector for a post using PHP.
*
* This way it's possible to select a post connector for posts based on their ID, categories, tags, post type, and so on
*
* This function is using the filter simple_fields_get_selected_connector_for_post that is called when
* simple fields determines what connector it should use for each post.
* It passes the connector slug and the post object and you should return the slug of the conector that you want to use.
You can’t perform that action at this time.