Skip to content

Instantly share code, notes, and snippets.

@BlackScorp
BlackScorp / Minifier.class.php
Created May 16, 2011 09:50
CSS Minifier class
<?php
/**
* Scorp Framework
* @copyright Coypright 2010, BlackScorp
* @package
* @subpackage ScorpFramework.
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
@BlackScorp
BlackScorp / hitbox.js
Created January 4, 2012 15:11
This are 2 Components for Crafty, with this Components it is possible to display collision Polygons of Enteties
//Draw Wired HitBox
Crafty.c("WiredHitBox", {
init:function(){
if (Crafty.support.canvas){
var c = document.getElementById('HitBox');
if(!c){
c = document.createElement("canvas");
c.id = 'HitBox';
c.width = Crafty.viewport.width;
c.height = Crafty.viewport.height;
@BlackScorp
BlackScorp / new.js
Created July 23, 2012 09:13
HashMap Crafty
function NewHashMap(cell){
var _map = {};
this.cellsize = cell || 64;
this.minCol = 1;
this.maxCol = 1;
this.map = function () { return _map; };
};
NewHashMap.prototype.insert = function (obj) {
var keys = this.key(obj);
var entry = new Entry(keys, obj, this);
var frontier_outpost ={ "height":64,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 159, 167, 176, 176, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 23, 33, 21, 22, 23, 20, 21, 0, 0, 0, 0, 0, 16, 16, 144, 176, 162, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 35, 33, 32, 26, 27, 24, 25, 26, 0, 0, 0, 0, 16, 152, 164, 176, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 28, 29, 30, 35, 28, 32, 30, 31, 28, 29, 30, 0, 0, 0,
@BlackScorp
BlackScorp / Loader.js
Created August 17, 2012 10:57
Kinetic Loader plugin
Kinetic.Loader = function(files){
this.files = files;
this.progressFunc = null;
this.errorFunc = null;
this.completeFunc = null;
Kinetic.Assets = {};
this.extensions ={
'jpg':'image',
'png':'image',
'gif':'image',
var frontier_outpost ={ "height":64,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 159, 167, 176, 176, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 23, 33, 21, 22, 23, 20, 21, 0, 0, 0, 0, 0, 16, 16, 144, 176, 162, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 35, 33, 32, 26, 27, 24, 25, 26, 0, 0, 0, 0, 16, 152, 164, 176, 150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 28, 29, 30, 35, 28, 32, 30, 31, 28, 29, 30, 0, 0, 0,
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="./index.html" class="brand">Bootstrap</a>
<div class="nav-collapse collapse">
<?= Form::open('brand/create') ?>
<legend><?= __('Login') ?></legend>
<?php if (isset($create_brand)): ?>
<div class="alert alert-error">
<?= Form::button('close', 'x', array('type' => 'button', 'class' => 'close', 'data-dismiss' => 'alert')); ?>
<?= $login_error ?>
</div>
<?php endif; ?>
<div class="control-group">
class Form extends Kohana_Form{
public static function input($name, $value = NULL, array $attributes = NULL)
{
if ( ! isset($attributes['id']))
{
// Default type is text
$attributes['id'] = $name;
//Controller/Action
$menu = array(
'brands'=>array(
'brand1'=>array(
'category1'=>array(
'item1'=>'name'
)
)
)
)