Skip to content

Instantly share code, notes, and snippets.

View fmundaca's full-sized avatar

Felipe Mundaca fmundaca

View GitHub Profile
@fmundaca
fmundaca / login.html
Last active October 16, 2017 02:15
Llamado a componente login pasandole una funcion que ejecutará asociada a otro controlador
<login-template on-login="login($login)"></login-template>
<!-- login() es una función que esta en el controlador -->
<!-- funcion del controlador -->
$scope.login = function (user) {
$scope.user = user;
makeLogin()
};
[{
"name":"Encuesta de Clima Laboral 2016",
"id":34,
"type":"process",
"description":"Encuesta de Clima Laboral 2016",
"due_date":null,
"start_date":"2016-08-22",
"status":1,
"role_in_process":"admin",
"can_view_monitoring":true,
# Traducciones adicionales en https://github.com/plataformatec/devise/wiki/I18n
es:
devise:
confirmations:
confirmed: "Su cuenta ha sido confirmada."
send_instructions: "Recibirá un correo electrónico en unos minutos con instrucciones sobre cómo restablecer su contraseña."
send_paranoid_instructions: "Si su correo electrónico existe en nuestra base de datos recibirá un correo electrónico en unos minutos con instrucciones sobre cómo reiniciar su contraseña."
failure:
already_authenticated: "Ya ha sido identificado."
@fmundaca
fmundaca / gist:3cc60b861160c55437e4
Last active August 29, 2015 14:16
Algoritmo resuelto
function playing(list,times){
var newArray = [];
var x = 0;
for(i=0;i<list.length;i++){
// console.log(list.length);
if(times > 0){
if(list.length%2 == 1){
// impar debemos eliminar desde el 0
@fmundaca
fmundaca / gist:5416408
Last active December 16, 2015 09:58
pollo's question
public function insertarNuevoTicket($usuario=null, $servicio=null, $componente=null, $finicio=null, $descripcion=null, $tipo_ticket=null, $nuevo_id=null) {
$stm=$this->pdo->prepare("INSERT INTO tickets VALUES( ".$nuevo_id.", '".$usuario."', '".$descripcion."', ".$tipo_ticket.", now(), ".$servicio.", ".$componente.", timestamp IS NULL, 0, 1, 0, 0);"); $query = "INSERT INTO tickets VALUES( ".$nuevo_id.", '".$usuario."', '".$descripcion."', ".$tipo_ticket.", now(), ".$servicio.", ".$componente.", NULL, 0, 1, 0, 0)";
echo "<br>".$query."<br>";
$stm->execute();
$row=0;
$row=$stm->rowCount();
return $row;
}
- (BOOL)isValidLocation:(CLLocation *)newLocation
withOldLocation:(CLLocation *)oldLocation
{
// Filter out nil locations
if (!newLocation)
{
NSLog(@"No es valido newLocation is Nil");
return NO;
}
@fmundaca
fmundaca / gist:4771335
Last active December 12, 2015 12:19
Ejecutar un bloque de código con un pequeño delay.
// NSObject+PWObject.h
#import <Foundation/Foundation.h>
@interface NSObject (PWObject)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
@end
/* NSObject+PWObject.m */
@fmundaca
fmundaca / gist:4758078
Created February 11, 2013 22:10
Poner una imágen como título de una UINavigationBar
// Create your image
UIImage *image = [UIImage imageNamed: @"logo.png"];
UIImageView *imageview = [[UIImageView alloc] initWithImage: image];
// set the text view to the image view
self.navigationItem.titleView = imageview;
models.Enterprises.find({'colaborators.rut':userRut}, "colaborators", callback);
models.Enterprises.find({'colaborators.rut':userRut}, callback);