Skip to content

Instantly share code, notes, and snippets.

@ferminhg
ferminhg / gist:4f613a416fd990442131
Created December 2, 2014 11:45
Corona SDK - Runtime Events
local function onSystemEvent( event )
local eventType = event.type
if ( eventType == "applicationSuspend" ) then
-- acciones necesarias cuando el dispositivo es suspendido
elseif ( eventType == "applicationResume" ) then
-- acciones para cuando la app vuelve de un estado suspendido
end
@ferminhg
ferminhg / gist:c39290254b6afeaa5047
Created December 2, 2014 11:52
Corona SDK - Using Native Alert Dialog
local function onComplete(event)
if "clicked" == event.action then
local i = event.index
if 1 == i then
-- No hacer nada, para cerrar el dialogo
elseif 2 == i then
-- Open url
system.openURL( "http://www.google.es" )
end
end
@ferminhg
ferminhg / gist:ec11f273b2da11bed713
Created December 3, 2014 08:19
Corona SDK - Working with JSON
local json = require "json"
--Lua script:
local luaTable = {
["name1"] = "value1",
["name2"] = {1, false, true, 23.54, "a string"},
name3 = json.null
}
local jsonData = json.encode( luaTable )
@ferminhg
ferminhg / gist:a035e94045c056a26d5c
Last active August 29, 2015 14:10
Corona SDK - Creating Button
local widget = require("widget")
--Function to handle button events
local function handleButtonEvent( event )
local phase = event.phase
if "ended" == phase then
print( "You pressed and released a button!")
end
end
@ferminhg
ferminhg / gist:c56f2ca7a870d427424d
Created December 3, 2014 08:54
Corona SDK - Creating Stepper Widgets. Incremento y decremento
local widget = require("widget")
local currentNumber = 0
-- Handle stepper events
local function onStepperPress(event)
if( "increment" == event.phase ) then
currentNumber = currentNumber + 1
elseif ( "decrement" == event.phase ) then
@ferminhg
ferminhg / gist:65f63f225c1eb2fef450
Created December 3, 2014 09:28
Corona SDK - Creating Segmented Control Widgets
local widget = require("widget")
local function onSegmentPress (event)
local target = event.target
print ("Segment Label is:", target.segmentLabel)
print ("Segment Number is:", target.segmentNumber)
end
local segmentedControl = widget.newSegmentedControl
{
@ferminhg
ferminhg / gist:e8005496152854d2f7af
Last active August 29, 2015 14:17
php-unit - Clase base php-unit yii
<?php
require_once("bootstrap.php");
class <Class>Test extends CDbTestCase
{
public function testSearch()
{
$criteria=new CDbCriteria;
$criteria->limit = 100;
$all = <Class>::model()->findAll($criteria);
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
and girlfriends or wives.
Whatever your age, gender, or income status, you may want to take up some sort of sewing art as a technique of reducing the load in your own life.Many hyperactive people claim that sewing lets their fingers to live busy while their bodies take a needed destroy.Sedentary consumers appreciate the opportunity to activate minds as well as hands through productive endeavors while seated in a favorite recliner or restful environment, perhaps watching tv or listening to music at the same time, or engaged in dialog with loved ones.There are individuals that crochet during their break plus lunch times at your workplace, or spend less their needlework pertaining to after dining while resting in the family location.Some work with their needle and thread as a focus stage for party with others who love this particular hobby.
Sewing, whether it be by knitting, crocheting, needlepoint, darning, or quilting, as well as other forms, provides a creative outlet for those who want to talk about beauty
Verifying that +ferminhg is my blockchain ID. https://onename.com/ferminhg