This file contains hidden or 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
| // display "add to home screen" floater on iphones | |
| // copy and paste this anywhere. | |
| (function(){ | |
| if (document.cookie.match(/ADD_HOME_TOUCH=1/)) return; | |
| document.addEventListener('DOMContentLoaded', function() { | |
| if (navigator.userAgent.match(/iphone|ipod/i)) { | |
| // create & inject css | |
| var parent = document.body; | |
| var arrowHeight = 56; | |
| var bubbleHeight = 130; |
This file contains hidden or 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
| <!doctype html> | |
| <!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
| <html> | |
| <head> | |
| <title>iOS 8 web app</title> | |
| <!-- CONFIGURATION --> |
This file contains hidden or 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
| pcall(require,"socket") | |
| local coroutine_scheduler = { | |
| _NAME = "coroutine_scheduler.lua" | |
| _VERSION = "1.0.0", | |
| } | |
| local Scheduler | |
| do Scheduler = setmetatable({}, { | |
| __call = function(class) |
This file contains hidden or 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
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express'); | |
| var app = module.exports = express.createServer(); | |
| io = require('socket.io').listen(app), |
This file contains hidden or 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
| /** | |
| * AStar | |
| * | |
| * Created by Paul Armstrong on 2011-05-26. | |
| * Copyright (c) 2011 Paul Armstrong Designs. All rights reserved. | |
| * | |
| * Based on: https://gist.github.com/827899 | |
| */ | |
| ig.module('plugins.a-star') |
This file contains hidden or 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
| var q= function(s){ return document.getElementById(s) } | |
| function send(){ | |
| var input = q('text'); | |
| socket.send(input.value); | |
| input.value = ''; | |
| } | |
| var socket = new io.Socket(null, { | |
| port: 8001, |
This file contains hidden or 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
| function queue(name){ | |
| queue.q[name]++ || (queue.q[name] = 1); | |
| return function(err){ | |
| if (err && queue.e[name]) queue.e[name](err); | |
| else if (err) throw err; | |
| process.nextTick(function(){ | |
| queue.q[name]--; | |
| queue.check(name); | |
| }); | |
| } |
This file contains hidden or 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
| function test1() { | |
| function test(j) { | |
| var s = 0; | |
| for (var i = 0; i < j; i++) s = i; | |
| for (var i = 0; i < j; i++) s = i; | |
| for (var i = 0; i < j; i++) s = i; | |
| for (var i = 0; i < j; i++) s = i; | |
| return s; | |
| } | |
This file contains hidden or 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
| // | |
| // WaxRetainIssueAppDelegate.m | |
| // WaxRetainIssue | |
| // | |
| // Created by Martin Cote on 11-02-17. | |
| // Copyright Loopycube 2011. All rights reserved. | |
| // | |
| #import "WaxRetainIssueAppDelegate.h" | |
| #import "WaxRetainIssueViewController.h" |
This file contains hidden or 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
| // A* path finding algorithm for impactjs game engine | |
| // adapted from http://stormhorse.com/a_star.js | |
| // via http://46dogs.blogspot.com/2009/10/star-pathroute-finding-javascript-code.html | |
| // impact-ified by jminor - http://pixelverse.org/ | |
| /* Example: | |
| this.pathFinder = new PathFinder(); | |
| var start = [((this.pos.x+this.size.x/2) / tilesize).floor(), ((this.pos.y+this.size.y/2) / tilesize).floor()]; | |
| var destination = [((target.pos.x+target.size.x/2) / tilesize).floor(), ((target.pos.y+target.size.y/2) / tilesize).floor()]; |