Skip to content

Instantly share code, notes, and snippets.

View tuefekci's full-sized avatar

Giacomo Tüfekci tuefekci

View GitHub Profile
@b1rdex
b1rdex / is-focused.js
Created February 25, 2014 05:48
node-webkit window.isFocused emulation
(function() {
window.frame = require("nw.gui").Window.get();
window.frame.isFocused = true;
var windowFocusHandler = function() {
window.frame.isFocused = true;
}
, windowBlurHandler = function() {
window.frame.isFocused = false;
<?php
function before($route)
{
$uri = request_uri();
$is_admin = preg_match('%^/admin(/.+)?$%', $uri);
# Authentication if required
$auth_required = $is_admin && $uri != "/admin/login" && $uri != "/admin/logout";
if($auth_required) authentication_is_required();
@marcomontes
marcomontes / gameengines.md
Created October 26, 2011 04:35 — forked from bebraw/gameengines.md
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out these pages: [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]].

Name Latest Release Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 1.3.1 (2011/05) 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
Aves Commer-cial Obsolete. Company bought by Zynga. [E3 2010 Aves Engine Prototype "Suburban World"](http://www.
@krisavi
krisavi / random.js
Created September 29, 2012 01:43
Our extenderEntity for convinience
me.ExtendEntity = me.ObjectEntity.extend({
init: function(x, y, settings) {
// melonJS / Tiled sprite width and height fallback
if(settings.spritewidth == undefined) settings.spritewidth = settings.width || 32;
if(settings.spriteheight == undefined) settings.spriteheight = settings.height || 32;
this.parent(x, y, settings);
// melonJS position fix.
this.pos.y = y;
@konsumer
konsumer / index.html
Created October 26, 2012 12:32
Load Flare levels in melonjs
<!DOCTYPE html>
<html>
<head>
<title>Iso Demo</title>
<style>
html, body {
padding:0;
margin:0;
}
#framecounter {
@agmcleod
agmcleod / timer-melonjs.js
Created December 6, 2012 15:35
Timer example melonjs
App = {
load: function() {
if(!me.video.init("app", 800, 600, false, 1.0)) {
alert("Your browser does not support the canvas.");
return;
}
me.loader.onload = this.loaded.bind(this);
me.loader.preload([]);
me.state.change(me.state.LOADING);
@pamelafox
pamelafox / twitter-bootstrap.scss
Created March 24, 2012 15:53
Bootstrap Android Overrides
body.android {
.modal {
@include box-shadow(none);
@include background-clip(border-box);
@include border-radius(0px);
border: 1px solid black;
}
.alert {
@include border-radius(0px);
text-shadow: none;
@tomi77
tomi77 / main.js
Created April 20, 2013 19:30
RequireJS "main config file" for Bootstrap
require.config({
paths: {
'bootstrap-affix': '../vendors/bootstrap/js/bootstrap-affix',
'bootstrap-alert': '../vendors/bootstrap/js/bootstrap-alert',
'bootstrap-button': '../vendors/bootstrap/js/bootstrap-button',
'bootstrap-carousel': '../vendors/bootstrap/js/bootstrap-carousel',
'bootstrap-collapse': '../vendors/bootstrap/js/bootstrap-collapse',
'bootstrap-dropdown': '../vendors/bootstrap/js/bootstrap-dropdown',
'bootstrap-modal': '../vendors/bootstrap/js/bootstrap-modal',
'bootstrap-popover': '../vendors/bootstrap/js/bootstrap-popover',
@ArnaudBan
ArnaudBan / px_to_em.scss
Last active December 16, 2015 19:39
Compass fonction to always work in em easily
@function px_to_em( $value, $context : 16 ){
@return ( $value / $context ) + 0em ;
}
@tamboer
tamboer / jquery_find_hover.js
Created April 30, 2013 07:42
jQuery table row tr hover
$(document).ready(function(){
$('.hover').hide();
$('tr').hover(
//over
function(){
$(this).find('.hover').show();
}
,
//out