Skip to content

Instantly share code, notes, and snippets.

View djekl's full-sized avatar
:octocat:
Working from home

Alan Wynn djekl

:octocat:
Working from home
View GitHub Profile
@djekl
djekl / CurlRequest.php
Created June 18, 2014 13:25
Example Curl Class Wrapper
<?php
class CurlRequest
{
private $api_key;
private $ch;
public function __construct($api_key)
{
$this->api_key = $api_key;

Follow this guide to integrate bar chart reports into your Laravel application. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

First put this into your page that will have the reports (in the Blade view) to include Morris library:

Did I hear you wanted AJAX charts instead of hard coded? You got it.

Follow this guide to integrate bar chart reports into your Laravel application with AJAX. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

Keybase proof

I hereby claim:

  • I am djekl on github.
  • I am djekl (https://keybase.io/djekl) on keybase.
  • I have a public key whose fingerprint is 928E 4816 1767 01CF 726B 9FD1 96DD EEDA 9DCA 2ECF

To claim this, I am signing this object:

Bootstrap 3 Slider for new site

This is still a work in progress, hoping to get this finished tonight

A Pen by Alan Wynn on CodePen.

License.

@djekl
djekl / Xbox oAuth Login.php
Created January 17, 2014 00:10
OLD CODE <DOES NOT WORK>
<?
define('CLIENT_ID', 'CLIENT_ID');
define('REDIRECT_URI', 'URL');
define('USERNAME', 'USERNAME');
define('PASSWORD', 'PASSWORD');
function curl_request($url, $cookie = '', $post_data = '', $headers_ary = '') {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
@djekl
djekl / convertTwoSpacesToFour.sublime-macro
Last active January 3, 2016 10:59 — forked from joshmfrankel/convertTwoSpacesToFour.sublime-macro
This now doesn't leave the whole text selected :)
[
{
"args": null,
"command": "select_all"
},
{
"args": {
"setting": "tab_size",
"value": 2
},
@djekl
djekl / gist:8254209
Last active January 2, 2016 04:59
This is what I fire before every request to check if the user is logged in, and if not then attempt via remember cookie, then fire the auth.login event if logged in.
<?php
App::before(function($request)
{
if (!Auth::check())
{
Auth::viaRemember();
if (Auth::check())
{
@djekl
djekl / PoC-Live-updating-Chart.js.md
Created November 11, 2013 21:57
A Pen by Alan Wynn.

PoC Live updating Chart.js

This is just a test of a chart.js line chart that changes based on updated data.

A Pen by Alan Wynn on CodePen.

License.

@djekl
djekl / example map.php
Created November 5, 2013 10:39
Google Maps Custom image map
<?php
$config['verbal_address'] = "Verbal Arts Centre\nStable Lane and Mall Wall, Bishop\nStreet Within, Londonderry, BT48 6PU";
$config['verbal_map_latlng'] = '54.9940,-7.3252';
$config['verbal_map_size']['width'] = '250';
$config['verbal_map_size']['height'] = '200';
$config['verbal_map_img'] = 'http://maps.googleapis.com/maps/api/staticmap?center=' . $config['verbal_map_latlng'];
$config['verbal_map_img'] .= '&zoom=16&size=' . $config['verbal_map_size']['width'] . 'x' . $config['verbal_map_size']['height'];
$config['verbal_map_img'] .= '&sensor=true';