Skip to content

Instantly share code, notes, and snippets.

View anoxic's full-sized avatar
🐙
working on it all at once

Bad Sir Brian anoxic

🐙
working on it all at once
View GitHub Profile
<?php
if(!empty($_POST))
{
// This is the error message you will display if something goes wrong. For now this will be empty:
$error = "";
// Wrap everything inside a "try" block so that you can display
// the error message but still also render your form.
try
{
These things:
* A list of named routes readable a little like a table of contents
* Specifying a handler is extra - the name is enough
* Reverse routing
* Simplified regex patterns allowing for strange url matching
* Easy handling of errors
But also this would be nice:
* Guards/middleware (not sure which one)
C#
Variables declared with types: char letter = 'c';
short int long byte ushort uint ulong float double decimal
char string
bool
Arrays declared with a []: int[] scores = new int[10] { 100, 95, 92, 87, 55, 50, 48, 40, 35, 10 };
Features:
* Named routes
* Reverse routing (to get the URL for a named route)
* Multiple patterns
* Guards
* Separate HTTP Verb/Method checking
* Error handling / Halting
Helpers:
* CSRF prevention
@anoxic
anoxic / swet.sw
Last active August 29, 2015 13:57
#<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#
~~~~~~~~ A try at something perhaps a little too minimal ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~ or not minimal enough ~~~~~~~~~~~~~~~~~~~~~
Swet tries to accomplish several things.
* Be as succinct as possible, sometimes making code denser,
but preferably actually making the code less dense.
<?php
/**
* Properly capitalize a name.
*
* @package NameCase
* @version 1.0.2
* @author Alex Dunae, Dialect <alex[at]dialect[dot]ca>
* @copyright Copyright (c) 2008, Alex Dunae
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @link http://dialect.ca/code/name-case/
// From: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage
// SESSION STORAGE
sessionStorage.setItem('fullname', 'John Paul'); // defining the session variable
alert("Your name is: " + sessionStorage.getItem('fullname')); // accessing it
alert("Hello " + sessionStorage.fullname); // another way of accessing the variable
sessionStorage.removeItem('fullname'); // finally unset it
sessionStorage.clear(); // removes all keys
// LOCAL STORAGE
@anoxic
anoxic / Hebrew
Last active December 29, 2015 22:48
Hebrew Manga:
http://israelmanga.tripod.com/
How to learn any language in 3 months or less:
http://www.fourhourworkweek.com/blog/2009/01/20/learning-language/
Most common Hebrew words:
http://www.cram.com/flashcards/100-most-common-biblical-hebrew-verbs-part-1-1301771
http://www.101languages.net/hebrew/most-common-hebrew-words/