Skip to content

Instantly share code, notes, and snippets.

View bartjkdp's full-sized avatar

Bart bartjkdp

View GitHub Profile

Keybase proof

I hereby claim:

  • I am bartjkdp on github.
  • I am bartjkdp (https://keybase.io/bartjkdp) on keybase.
  • I have a public key ASD94zjqcLNGb1HfzNaAhTzEWlEmy9vTYLjyIk1KoNamxAo

To claim this, I am signing this object:

@bartjkdp
bartjkdp / apns-http2.php
Created July 24, 2016 14:18
Send push notification through Apple Push Notification Service (APNS)
<?php
$token = "<device-token>";
$message = array(
'aps' => array(
'alert' => 'hi there',
'badge' => 1,
'sound' => 'default'
)
);
@bartjkdp
bartjkdp / le-renew-webroot
Last active February 9, 2016 14:40 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
<?php
ini_set('display_errors', 1);
$_SERVER["HTTP_HOST"] = "pleio.dev";
$_SERVER["HTTPS"] = false;
require_once(dirname(__FILE__) . "/engine/start.php");
$options = array(
'type' => 'object',
<?php
ini_set('display_errors', 1);
$_SERVER["HTTP_HOST"] = "pleio.dev";
$_SERVER["HTTPS"] = false;
require_once(dirname(__FILE__) . "/engine/start.php");
$user = get_user_by_username('admin');
login($user);
@bartjkdp
bartjkdp / entities-to-sql.php
Last active August 29, 2015 14:12
ELGG Entities to SQL
<?php
require_once(dirname(__FILE__) . "/engine/start.php");
$guids = array(28386102,28380552,28382572,28383902,29136752,29124682,29139712,29139502,29138962);
$fetch_guids = array();
function getChildrenEntities($guid) {
global $fetch_guids;
if (!in_array($guid, $fetch_guids)) {