This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Die = { | |
roll = function(self) | |
self.value = math.random(self.sides) | |
end | |
} | |
Die["__index"] = Die | |
function D(sides, value) | |
local die = {sides = sides, value = value} | |
setmetatable(die, Die) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
--- | |
Port from the YUI3 event-simulate functionality to vanilla javascript. | |
... | |
*/ | |
(function(global, document){ | |
var mix = function(obj1, obj2){ | |
for (var key in obj2){ | |
obj1[key] = obj2[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @fileOverview Generates "Lorem ipsum" style text. | |
* @author [email protected] Rick Viscomi, | |
* [email protected] Mathew Tinsley | |
* @version 1.0 | |
*/ | |
/** | |
* Copyright (c) 2009, Mathew Tinsley ([email protected]) | |
* All rights reserved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery alterClass plugin | |
* | |
* Remove element classes with wildcard matching. Optionally add classes: | |
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' ) | |
* | |
* Copyright (c) 2011 Pete Boere (the-echoplex.net) | |
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Clamps a number. Based on Zevan's idea: http://actionsnippet.com/?p=475 | |
* params: val, min, max | |
* Author: Jakub Korzeniowski | |
* Agency: Softhis | |
* http://www.softhis.com | |
*/ | |
(function(){Math.clamp=function(a,b,c){return Math.max(b,Math.min(c,a));}})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Font Smoothie copyright 2013,14,15 Torben Haase <http://pixelsvsbytes.com> | |
// Source-URL <https://gist.github.com/letorbi/5177771> | |
// | |
// Font Smoothie is free software: you can redistribute it and/or modify it under | |
// the terms of the GNU Lesser General Public License as published by the Free | |
// Software Foundation, either version 3 of the License, or (at your option) any | |
// later version. | |
// | |
// Font Smoothie is distributed in the hope that it will be useful, but WITHOUT | |
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Two dashes start a one-line comment. | |
--[[ | |
Adding two ['s and ]'s makes it a | |
multi-line comment. | |
--]] | |
---------------------------------------------------- | |
-- 1. Variables and flow control. | |
---------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- mathlib.lua | |
--[[ | |
Maths extension library for use in Corona SDK by Matthew Webster. | |
All work derived from referenced sources. | |
twitter: @horacebury | |
blog: http://springboardpillow.blogspot.co.uk/2012/04/sample-code.html | |
code exchange: http://code.coronalabs.com/search/node/HoraceBury | |
github: https://gist.github.com/HoraceBury |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: --> | |
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png"> | |
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≤ 6: --> | |
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png"> | |
<!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: --> | |
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png"> | |
<!-- For iPhone with high-resolution Retina display running iOS ≤ 6: --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SecureSessionHandler extends SessionHandler { | |
protected $key, $name, $cookie; | |
public function __construct($key, $name = 'MY_SESSION', $cookie = []) | |
{ | |
$this->key = $key; | |
$this->name = $name; |
OlderNewer