Skip to content

Instantly share code, notes, and snippets.

View thehydroimpulse's full-sized avatar

Daniel Fagnan thehydroimpulse

View GitHub Profile
@thehydroimpulse
thehydroimpulse / SplClassLoader.php
Created February 16, 2012 05:10 — forked from wilmoore/SplClassLoader.php
PHP 5.3 Namespace Autoloader
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@thehydroimpulse
thehydroimpulse / gist:2872907
Created June 5, 2012 05:42
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/
@thehydroimpulse
thehydroimpulse / C++0x_Maybe_Monad.cpp
Created July 7, 2012 08:53 — forked from pskupinski/C++0x_Maybe_Monad.cpp
My maybe monad implementation in C++0x.
// This code is in the public domain, feel free to use it in anyway you'd
// like to.
#include <iostream>
#include <functional>
using namespace std;
template<class A>
class Maybe {
protected:
A a;
@thehydroimpulse
thehydroimpulse / index.html.haml
Created August 20, 2012 11:57 — forked from timgremore/index.html.haml
Ember.js, document collection and polling...written in CoffeeScript
- title "#{@game.name}"
%h1= yield(:title)
#documents
= form_tag(assessment_game_documents_path(@game)) do
%ul
%script{ type: "text/x-handlebars" }
{{#collection Game.DocumentsCollectionView contentBinding="Game.documentsController"}}
%li {{content.name}}
{{/collection}}
@thehydroimpulse
thehydroimpulse / CoffeeScript
Created September 4, 2012 08:22
Javascript vs Coffeescript
class Person
@name: null
@age: 18
constructor: (@name, @age) ->
if @name == 'Hello'
$(".name").html "Yeah, you made it!"
if @age > 18
$(".age").html "Welcome home!@"
@thehydroimpulse
thehydroimpulse / .project
Created September 7, 2012 04:11
HelloWorld
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ExampleNettyWebServer</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
class App.PostsController extends App.ApplicationController
# Enable single-page controller:
@socket.enable()
# Authorization
@before "authenticate_user"
@before "authenticate_admin"
# Ability Class
@Ability.can "create", App.Post
@thehydroimpulse
thehydroimpulse / OS Check
Created September 28, 2012 01:31
OS Check
ifneq (,$(findstring /cygdrive/,$(PATH)))
UNAME := Cygwin
else
ifneq (,$(findstring WINDOWS,$(PATH)))
UNAME := Windows
else
UNAME := $(shell uname -s)
endif
endif
Processing by ApplicationController#index as HTML (GET)
Parameters: { action: 'index', format: 'html' }
App.ApplicationController { headers: {},
status: 200,
request:
{ socket:
{ _handle: [Object],
_pendingWriteReqs: 0,
_flags: 0,
_connectQueueSize: 0,
@ECHO OFF
:; Clear the screen and turn echo off (above) to keep it clean
CLS
SET PPath=
SET FPath=
:; Get Value from 'where make' command output
FOR /F "" %%i in ('where make') do SET PPath=%%i