Skip to content

Instantly share code, notes, and snippets.

Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
@tml
tml / visitor.js
Last active August 29, 2015 14:13 — forked from tuchida/visitor.js
function parse(str) {
var ir = Packages.jdk.nashorn.internal.ir;
var runtime = Packages.jdk.nashorn.internal.runtime;
var parser = Packages.jdk.nashorn.internal.parser;
var context = runtime.Context.getContext();
var source = new runtime.Source('test', str);
var node = new parser.Parser(context.getEnv(), source, new runtime.Context.ThrowErrorManager(), true).parse();
var lexContext = new ir.LexicalContext();
<?php
Class Mysql extends mysqli{
public function __construct($registry){
// define registry property
$this->registry = $registry;
// initialize parent constructor
parent::__construct($this->registry->config->database->hostname, $this->registry->config->database->username, $this->registry->config->database->password, $this->registry->config->database->database);
}
<?php
Class Mysql extends mysqli{
private $revertDb = false;
public function __construct($registry){
// define registry property
$this->registry = $registry;
// initialize parent constructor
parent::__construct($this->registry->config->database->hostname, $this->registry->config->database->username, $this->registry->config->database->password, $this->registry->config->database->database);
/*
* Gordon: An open source Flash™ runtime written in pure JavaScript
*
* Copyright (c) 2010 Tobias Schneider
* Gordon is freely distributable under the terms of the MIT license.
*/
(function(ba){function D(d){return d/A.PX_IN_TWIPS}function ta(){this.list=this.next=null}function ua(){this.n=this.b=this.e=0;this.t=null}function fa(d,h,k,c,b,s){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var a=new Array(this.BMAX+1),z,m,o,g,j,p,w,i=new Array(this.BMAX+1),e,l,n,q=new ua,r=new Array(this.BMAX);g=new Array(this.N_MAX);var t,x=new Array(this.BMAX+1),v,B,u;u=this.root=null;for(j=0;j<a.length;j++)a[j]=0;for(j=0;j<i.length;j++)i[j]=0;for(j=0;j<r.length;j++)r[j]=
null;for(j=0;j<g.length;j++)g[j]=0;for(j=0;j<x.length;j++)x[j]=0;z=h>256?d[256]:this.BMAX;e=d;l=0;j=h;do{a[e[l]]++;l++}while(--j>0);if(a[0]==h){this.root=null;this.status=this.m=0}else{for(p=1;p<=this.BMAX;p++)if(a[p]!=0)break;w=p;if(s<p)s=p;for(j=this.BMAX;j!=0;j--)if(a[j]!=0)break;o=j;if(s>j)s=j;for(v=1<<p;p<j;p++,v<<=1)i
@tml
tml / Ancient Beast Bestiary
Created March 15, 2012 03:17 — forked from DreadKnight/Ancient Beast Bestiary
creatures displayed in table based levels and sins
<?php $page_title = "Ancient Beast - Bestiary";
include("../header.php");
include("../global.php");
?>
<script type="text/javascript" src="<?php echo $WorkingDir; ?>utils/tinybox.js"></script>
<?php
echo "$start_div<div style='text-align:center; position:absolute;'>";
$pdo = new PDO(...);
$q = $pdo->query("SELECT * FROM ab_creatures ORDER BY sin, lvl");
$rows = $q->fetchAll();
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@tml
tml / gist:4428077
Created January 1, 2013 15:13 — forked from tredoe/gist:4419687

Thanks to languages like Go and Rust the developers can now build software for the command line that can run in every architecture and system where those languages can compile. And this is awesome, you code an application which can be compiled in Windows, Mac OS or Linux, getting a full market of users just like with web applications.

Now, the next step is create graphical applications using the same code for those systems. To get this goal is necessary to build libraries of low level that provide access to graphics, audio and input. Later can be built a graphical toolkit. Step by step.

<div class="input-prepend">
<span class="add-on">Day: </span
<select name="day" id="day" class="input-block-level">
<!-- 1 = Sunday ... -->
<!-- somewhere in a common location in your code: $days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); -->
<?php foreach($days as $d=>$n): ?>
<option value="<?php echo $d;?>" <?php if ($d == $col) echo 'selected="selected"'; ?>><?php echo $n?></option>
<?php endforeach; ?>
</select>
</div>

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

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

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n