Skip to content

Instantly share code, notes, and snippets.

View rbreve's full-sized avatar

Roberto Brevé rbreve

  • Finland
View GitHub Profile
@rbreve
rbreve / GoogleNow
Created May 6, 2013 00:18
Google now commands
Convenience
Remind me to (task) in (time). // Note to self _______.
Set alarm for (time a.m. / p.m.), label ______. // Wake me up in (time).
Call the (place) in (location)
Text "contact name" "message"
Send email to ______, subject ____, message _______.
Listen to/Play/Show me (song)
Youtube ______.
(Contact Name) ---> shows contact card
@rbreve
rbreve / config.lua
Created July 15, 2013 18:31
Ultimate config.lua for Corona
if string.sub(system.getInfo("model"),1,4) == "iPad" then
application =
{
content =
{
width = 360,
height = 480,
scale = "letterBox",
xAlign = "center",
yAlign = "center",
settings =
{
orientation =
{
default = "portrait",
supported = { "portrait" }
},
android =
{
usesPermissions =
--local storyboard = require "storyboard"
--storyboard.gotoScene( "chooseLevel" )
local facebook = require("facebook")
local json = require("json")
-- listener for "fbconnect" events
local function listener( event )
if ( "session" == event.type ) then
-- upon successful login, request list of friends
{
"scene": {
"name": "scene1",
"imageName": "photo1.JPG",
"backLink":"",
"links" : [
{
"zone":[10,10,150,150],
"link_to":"scene2"
},
@rbreve
rbreve / crawler.rb
Last active December 29, 2015 11:39
crawlea actas del tse
require 'open-uri'
require 'nokogiri'
for i in 1..16000
# u = "http://siede.tse.hn/app_dev.php/divulgacionmonitoreo/reporte-acta/#{i}"
u="http://s3.amazonaws.com/actas2013/icr/40/1/%05d104.jpg" % i
print u
openu=""
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:theme="@android:style/Theme.NoTitleBar"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
@rbreve
rbreve / gist:3f244574d7ab0e558d2d
Created September 4, 2014 20:24
Detect one tap in Unity3d
if(Input.touchCount == 1){
Touch touch = Input.GetTouch(0);
if(touch.phase == TouchPhase.Ended){
handleTouch(touch.position);
}
}
@rbreve
rbreve / sphereGameobject.cs
Last active August 29, 2015 14:06
Placing objects around a sphere in Unity3D
// sphere radius
float r= 5f;
Vector3 randomPosition = Random.onUnitSphere*r;
GameObject o = Instantiate(item, randomPosition, Quaternion.identity ) as GameObject;
Vector3 up = randomPosition;
Vector3 LookAt = Vector3.Cross(up, -transform.right) + up;
o.transform.LookAt(LookAt, up);
@rbreve
rbreve / once.cs
Created October 8, 2014 03:34
Unity3D animator play once
public IEnumerator PlayOneShot ( string paramName )
{
anim.SetBool( paramName, true );
yield return new WaitForSeconds (anim.GetCurrentAnimatorStateInfo(0).length/2);
anim.SetBool( paramName, false );
}
// Use this for initialization