Skip to content

Instantly share code, notes, and snippets.

var Urls = [];
function TemplateRepository(){
}
TemplateRepository.prototype.loadTemplates = function(callback){
$.ajax({
url:
@hugozap
hugozap / bootstrap-datepicker-ko.js
Last active December 23, 2015 03:49
Bootstrap-datepicker knockoutjs binding
/* Adds the binding dateValue to use with bootstra-datepicker */
ko.bindingHandlers.dateValue = {
init:function(element,valueAccessor,allBindingsAccessor,viewModel,bindingContext){
var dpicker = $(element).datepicker({
format:"yyyy-mm-dd"
}).on('changeDate',function(ev){
var newDate = new Date(ev.date);
var value = valueAccessor();
value(newDate);
});
@hugozap
hugozap / elementinviewport.js
Created January 14, 2014 18:51
Element in viewport JS (jquery)
function elementInViewPort(elem){
var $elem = $(elem);
var top = $elem.offset().top;
var height = $elem.height();
return insideViewPort(top,height);
}
{
"result":true
}
/* 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>