Skip to content

Instantly share code, notes, and snippets.

View codyphobe's full-sized avatar
🏍️
Chasing the sunset

Cody codyphobe

🏍️
Chasing the sunset
View GitHub Profile
@codyphobe
codyphobe / Ajax-Instructions.md
Created April 25, 2014 00:57 — forked from msurguy/Ajax-Instructions.md
Morris bar charts with AJAX (Laravel)

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/

@codyphobe
codyphobe / composer.json
Last active August 29, 2015 14:21
Laravel & Websockets
"textalk/websocket": "1.0.*",
"cboden/ratchet": "0.3.*"
@codyphobe
codyphobe / PreventReplayAttack.php
Last active August 29, 2015 14:21 — forked from Kreshnik/PreventReplayAttack.php
Laravel 5 - PreventReplayAttack Middleware
<?php namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Session;
class PreventReplayAttack
{

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@codyphobe
codyphobe / markdown.css
Last active August 29, 2015 14:25 — forked from imjasonh/markdown.css
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@codyphobe
codyphobe / redis_socketio.js
Last active August 29, 2015 14:25 — forked from lukepolo/Laravel - Socket.IO + Redis
Redis-backed WebSocket server using Socket.IO
var base_path = __dirname.replace('resources/nodejs', '');
require('dotenv').config({
path: base_path+'.env'
});
var port = process.env.NODE_SERVER_PORT,
redis = require('redis'),
redis_client = redis.createClient(),
cookie = require('cookie'),
os = require('os'),
@codyphobe
codyphobe / nginx.conf
Last active August 29, 2015 14:25 — forked from hilbix/nginx.conf
Example for Cookie-based Access Token with NginX HttpSecureLinkModule http://wiki.nginx.org/HttpSecureLinkModule and PHP (in this case for Typo3). Note that Typo3 needs to set the cookie as shown in token.php
# Excerpt of nginx config file
#..
#
set $ts 0;
if ($cookie_TOKEN ~ ",(.*)$") {
set $ts $1;
}
secure_link $cookie_TOKEN; # See TYPO3_ACCESSTOKEN
set $sec CHANGE_THIS_SHARED_SECRET; # See TYPO3_ACCESSKEY
secure_link_md5 $sec$ts$sec;
@codyphobe
codyphobe / gist:f452a453c74c709ceac2
Last active August 29, 2015 14:26 — forked from steveneaston/gist:73d623549a2c414f2789
Initialise properties Sublime macro
{
"keys": ["super+i"],
"command": "run_macro_file",
"args": {"file": "Packages/User/Macros/initialize_properties.sublime-macro"},
"context": [{"key": "selector", "operator": "equal", "operand": "source.php"}]
}
@codyphobe
codyphobe / NullingTrait.php
Last active September 5, 2015 22:36 — forked from dwightwatson/NullingTrait.php
NullingTrait.php
<?php namespace App\Support;
trait NullingTrait
{
/**
* Boot the trait. Adds an observer class for nulling.
*
* @return void
*/
public static function bootNullingTrait()
@codyphobe
codyphobe / global-homestead.sh
Created September 24, 2015 21:21 — forked from taylorotwell/global-homestead.sh
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...