Skip to content

Instantly share code, notes, and snippets.

View hcosta's full-sized avatar

Hektor hcosta

View GitHub Profile
@hcosta
hcosta / gist:6b7d0d3c0188692091f8
Created December 7, 2014 12:51
Adb out of date with Genymotion
if yes this error probably came out because adb from genymotion conflicted with your adb from android SDK(using same port number), to fix this simply go to settings => choose ADB tab => click on option Use custom Android SDK Tools and set your SDK folder
after you configure this, try to restart your adb by going into folder platform-tools which adb placed and do this command:
./adb kill-server
./adb start-server
@hcosta
hcosta / gist:cd960e148e5e3653b1f9
Created December 8, 2014 14:20
Cordova run on target device
adb devices
cordova run android --target=ID
@hcosta
hcosta / gist:bae0d82b6db3f20c688f
Created December 31, 2014 15:55
git remove all
delete all files manually and commit it
git add -u :/ ----> if not work try just git add -u
git commit -m "Deleted files manually"
@hcosta
hcosta / launcher.bat
Created March 22, 2015 22:51
no juegues tanto, el bat definitivo
@echo off
set hr=%TIME:~0,2%
if %hr% geq 7 (
if %hr% leq 19 (
Msg * "TRABAJA Y NO JUEGUES TANTO!"
exit
)
)
@hcosta
hcosta / gist:a8307a48030908693b6c
Last active August 29, 2015 14:19
Install apk on target and overwrite
adb devices
adb -s device-id install -r packet.apk
adb -s device-id logcat
@hcosta
hcosta / screenshot
Created June 30, 2015 14:06
screenshot android
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png
@hcosta
hcosta / with.c
Last active September 21, 2015 15:48
Gestionar varias instancias de objeto en GML
Hay que utilizar la cláusula with. Con ella puedes acceder de forma cómoda
a las propiedades y variables de cada instancia.
Por un lado puedes acceder a una instancia específica de objeto así:
with(id_instancia) {
// dentro del bloque todo el código afectará como si estuvieras en la instancia
show_debug_message(id); // devolverá el id de la instancia
speed = 10; // establecerá la velocidad de la instancia
}
Proceso SumaImpares
Definir n, total, i como Enteros;
// Leemos un número entero
Leer n;
// Si es par le restamos 1
Si (n mod 2 == 0) Entonces
n <- n-1;
FinSi
// Ahora ya tenemos el número impar máximo en n
// Hacemos el Para desde el número 1 hasta n de dos en dos
Proceso Promedio
Definir i, n_notas, nota, resultado como Numericos;
// Iniciamos a cero el resultado donde iremos haciendo los cálculos
resultado <- 0;
// Preguntamos cuantas notas quiere introducir el usuario
Escribir "¿Cuantas notas quieres introducir? Escribe un número";
Leer n_notas;
{
"cmd": ["/home/USUARIO/anaconda3/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}