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 / psn_friends.php
Created November 10, 2012 20:11 — forked from meg87/psn_friends.php
PHP class to access PlayStation Network friends list.
<?php
// Disable libxml errors and allow user to fetch error information as needed
libxml_use_internal_errors(true);
class PSN_friends
{
public $log_file, $session, $frineds;
function __construct()
{
@djekl
djekl / get_key.php
Created November 13, 2012 15:29 — forked from joostvanveen/get_key.php
Helper function that returns the value for a key in an array or a property in an object. No more endless isset() statements.
<?php
/**
* Return the value for a key in an array or a property in an object.
* @param mixed $haystack
* @param string $needle
* @param mixed $default_value The value if key could not be found.
* @return mixed
*/
function get_key ($haystack, $needle, $default_value = '')
{
<?php
/**
* Generate an encryption key for CodeIgniter.
* http://codeigniter.com/user_guide/libraries/encryption.html
*/
// http://www.itnewb.com/v/Generating-Session-IDs-and-Random-Passwords-with-PHP
function generate_token ($len = 32)
{
@djekl
djekl / Sublime Text 2 - Useful Shortcuts (Mac OS X).textile
Created June 5, 2013 16:33 — forked from jonahvsweb/gist:4354137
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@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
},

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/

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:

@djekl
djekl / sm-annotated.js
Created July 1, 2014 16:31 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
(function() {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
<?php
namespace Acme\Html;
use Illuminate\Html\FormBuilder as IlluminateFormBuilder;
class FormBuilder extends IlluminateFormBuilder {
/**
* An array containing the currently opened form groups.

Ubuntu 14.04+ 32bit (ubuntu-mate.org)

Simple steps for installing required tools after fresh Ubuntu install.
Or use installer and uninstaller scripts, they won't break anythng!!

Included

  • Licensed Sublime Text 3 (build 3065)
  • Nginx 1.6.2 (stable version)
  • PHP 5.6.3 (stable version)
  • NVM v0.20.0 (for Node.js and NPM)