Skip to content

Instantly share code, notes, and snippets.

/* Some bitmap utilities for android */
/* Taken from StackOverflow answers */
public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) {
int width = bm.getWidth();
int height = bm.getHeight();
float scaleWidth = ((float) newWidth) / width;
float scaleHeight = ((float) newHeight) / height;
// CREATE A MATRIX FOR THE MANIPULATION
Matrix matrix = new Matrix();
@hugozap
hugozap / debugPanel.lua
Created March 14, 2014 07:15
Debugging panel for coronasdk (draft)
-- Debugging panel
-- call init and then print
local panel = {}
local textureMemory
local panelObj
local message = ""
local messageObj
local container
{
"name":"facturacion",
"rows":[
{
"id":"1",
"name":"Registro 1",
"quantity":"5000"
},
{
"id":"2",
{"success":true,"error":null,"data":"[{\"Quantity\":1,\"Amount\":1000.00,\"Description\":\"Prueba\",\"id\":\"186af2be-66a2-42f6-953d-480005f17c75\",\"idParent\":\"94edd601-e448-413c-a069-008f8d0f2f66\"},{\"Quantity\":2,\"Amount\":2000.00,\"Description\":\"Prueba\",\"id\":\"04f087a3-a156-4e0e-99d3-9a713e5e5f43\",\"idParent\":\"94edd601-e448-413c-a069-008f8d0f2f66\"}]","warning":null}
#/
# Script that generates a release package for SuccessSellerCenter
# It fixes the templates path in appManager.js file
# Step 1. Verify that we are on the correct folder
echo $PWD
REGEX='.*SellerSuccessCenter'
if [[ $PWD =~ $REGEX ]]; then
echo "OK. Inside SellerSuccessCenter"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<img src="http://broken.com/brokenimage.jpg" alt="">
<img src="http://noexiste.com/noexiste.jpg" onerror="alert('onerror fired removing broken image');this.style.display='none';" alt="">
</body>
{"rows":[{"name":"Diana","age":24},{"name":"Rose","age":23},{"name":"Maria","age":22},{"name":"Alan","age":21},{"name":"Angelica","age":29}]}
var shoe = require('shoe');
var through = require('through');
var http = require('http');
var ecstatic = require('ecstatic');
var MuxDemux = require('mux-demux');
var server,sock,sourcestreams = [];
var samplestream = require("./samplestream.js");
//Create an array with 100 streams and send them through one shoe connection
@hugozap
hugozap / index.js
Created January 9, 2015 17:18
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
/* modified to be compatible with browserify */
var ko = require('knockout');
var WM = require('weakmap');
/*!
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/