Skip to content

Instantly share code, notes, and snippets.

View desamtralized's full-sized avatar
🦀

desamtralized desamtralized

🦀
View GitHub Profile
Front-end Developer
Buscamos um Front-end Developer, freelancer para alocação full-time temporária,
com experiência em Web e Mobile para realizar inicialmente as seguintes tarefas:
- Finalizar um site em Wordpress. (Site está 90% completo).
- Desenvolver versão HTML5 (Desktop e Mobile) de Aplicativo com acesso às APIs do Google Maps e APIs REST.
Necessário saber algum Framework MVC Javascript e ter experiência com Phonegap.
Favor enviar referência de pelo menos 4 trabalhos (2 mobiles, 2 desktop) e link para o Github / Linkedin.
//Separate firstname and lastname
var fullName = 'Samuel Barbosa dos Santos';
var nameParts = fullName.split(' ');
var firstName = nameParts.shift();
var lastName = nameParts.join(' ').trim();
//Phone Mask
// jQuery Mask Plugin v1.5.4
// github.com/igorescobar/jQuery-Mask-Plugin
$('.phone').mask('(00)00000-0000');
public class DateUtils {
private long secondMillis = 1000,
minuteMillis = 60 * secondMillis,
hourMillis = 60 * minuteMillis,
dayMillis = 24 * hourMillis;
public String getRelativeTime(Date from, Date to) {
long fromMillis = from.getTime();
long toMillis = to.getTime();
@desamtralized
desamtralized / ParseDelegate.kt
Created June 3, 2015 03:12
Accessing ParseObject properties in a easy way using Kotlin Data Class and Delegate.
//Define your sublclass of ParseObject
ParseClassName("Person")
public data class Person : ParseObject() {
var name: String by ParseDelegate<String>()
var age: Int by ParseDelegate<Int>()
var avatar: ParseFile by ParseDelegate<ParseFile>()
}
//Define ParseDelegate
public class ParseDelegate<T> {
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
import com.google.gson.annotations.SerializedName;
public class AddressComponent {
@SerializedName("long_name")
private String longName;
@SerializedName("short_name")
private String shortName;
private String[] types;
package com.sambarboza
import com.parse.ParseObject
import kotlin.reflect.KProperty
public class ParseDelegate<T> {
@Suppress("UNCHECKED_CAST")
operator fun getValue(parseObj: ParseObject, propertyMetadata: KProperty<*>): T {
return parseObj.get(propertyMetadata.name) as T
}
@ParseClassName("Car")
class Car : ParseObject() {
var brand: String?
get() {
return this.getString("car")
}
set(value) {
this.put("car", value)
}
@desamtralized
desamtralized / Car.kt
Last active January 12, 2016 01:22
Car class using ParseDelegate
@ParseClassName("Car")
class Car : ParseObject() {
var brand by ParseDelegate<String?>()
var image by ParseDelegate<ParseFile?>()
}
'use strict';
/**
* controller test
*/
angular.module('inOutDeliveryAdmin.test', ['ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/test', {
templateUrl: 'test/test.html',
controller: 'TestCtrl'
})