Skip to content

Instantly share code, notes, and snippets.

@leyluj
leyluj / recorder.js
Last active February 9, 2020 16:27
Record Browser Input for Cypress
"use strict";
/*
## author: Andres Santos (andres.santos@neoris.com)
## Demo usage
- Add the next lines to your main html file so that the cypressRecorder start working
- <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
- <script src="http://www.cemexgo.com/cdn/cypress/cypressRecorder.js" type="text/javascript"></script>
- once you added those two scripts open your browser developer console and within the console you can run any of these two methods
function convert($size)
{
$unit=array('b','kb','mb','gb','tb','pb');
return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];
}
@leyluj
leyluj / cordova file script.js
Last active August 29, 2015 14:15
Cordova File Script
/*
Here is what I am using for my Android and IOS apps
Keep attention to a couple of things:
- Android and IOS have other directorynames for files
- Android devices have different root (myFSRootDirectory1 = Samsung Tab 3, msFSRootDirectory2 = Samsung SII)
- $cordovaFile functions prefixes all pathnames with root
$cordovaFileTransfer functions needs absolute pathnames
Here I create the prefixes for File functions and FileTransfer functions for Android and IOS
*/
@leyluj
leyluj / form
Created February 4, 2014 12:33 — forked from duskohu/form
<?php
$form->addDatePicker('date', 'Date')
->setDefaultValue(new DateTime());
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter MY_Model Class
*
* Base model with CRUD functions for CodeIgniter Framework.
* Bassed on Jamie Rumbelow model base class.
*
* @package CodeIgniter
* @subpackage Libraries