Skip to content

Instantly share code, notes, and snippets.

View caubry's full-sized avatar
🌵

Caroline Aubry caubry

🌵
View GitHub Profile
@caubry
caubry / imageCompression.sh
Last active December 13, 2023 14:50
Bash script using pngquant and jpegoptim library to compress PNG, JPG and JPEG, with batch compression as an option.
#!bin/bash
pwd=`pwd`
# Set the quality factor to 80
qualityCompression=80;
# Set a minimum quality factor to 20
qualityLimit=20;
# To run a new compression
second_run_compression=false;
# For batch compression

Keybase proof

I hereby claim:

  • I am caubry on github.
  • I am lilydrop (https://keybase.io/lilydrop) on keybase.
  • I have a public key ASBGJR5OhBO6BM2EUYxSIqXwDa22wigpUdnaxjNECK5RHgo

To claim this, I am signing this object:

var gCachedAssets = {};
function loadAssets(assetList, callbackFcn) {
var loadBatch = {
count: 0,
total: assetList.length,
cb: callbackFcn
};
for(var i = 0; i < assetList.length; i++) {
Vec2 = Box2D.Common.Math.b2Vec2;
BodyDef = Box2D.Dynamics.b2BodyDef;
Body = Box2D.Dynamics.b2Body;
FixtureDef = Box2D.Dynamics.b2FixtureDef;
Fixture = Box2D.Dynamics.b2Fixture;
World = Box2D.Dynamics.b2World;
MassData = Box2D.Collision.Shapes.b2MassData;
PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;
CircleShape = Box2D.Collision.Shapes.b2CircleShape;
DebugDraw = Box2D.Dynamics.b2DebugDraw;
Vec2 = Box2D.Common.Math.b2Vec2;
BodyDef = Box2D.Dynamics.b2BodyDef;
Body = Box2D.Dynamics.b2Body;
FixtureDef = Box2D.Dynamics.b2FixtureDef;
Fixture = Box2D.Dynamics.b2Fixture;
World = Box2D.Dynamics.b2World;
MassData = Box2D.Collision.Shapes.b2MassData;
PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;
CircleShape = Box2D.Collision.Shapes.b2CircleShape;
DebugDraw = Box2D.Dynamics.b2DebugDraw;
intersectRect: function (r1, r2) {
return !(r2.left > r1.right ||
r2.right < r1.left ||
r2.top > r1.bottom ||
r2.bottom < r1.top);
}
GameEngineClass = Class.extend({
move_dir: new Vec2(0,0),
dirVec: new Vec2(0,0),
gPlayer0: {
pos: {
x: 100,
y: 100
},
GameEngineClass = Class.extend({
move_dir: new Vec2(0,0),
dirVec: new Vec2(0,0),
gPlayer0: {
pos: {
x: 100,
y: 100
},
GameEngineClass = Class.extend({
move_dir: new Vec2(0,0),
dirVec: new Vec2(0,0),
gPlayer0: {
pos: {
x: 100,
y: 100
},
InputEngineClass = Class.extend({
bindings: {},
actions: {},
mouse: {
x: 0,
y: 0
},