Skip to content

Instantly share code, notes, and snippets.

View gabovanlugo's full-sized avatar

Gabo Lugo gabovanlugo

View GitHub Profile
@gabovanlugo
gabovanlugo / factory
Created July 25, 2017 17:01
Factory with annotation
const adjustmentService = function (
// TODO Create Adjustments sercives
AdjustmentsQuery) {
'ngInject';
// TODO Create Adjustments sercives
const service = AdjustmentsQuery;
const pageSize = 20;
// generated on 2016-03-29 using generator-webapp 2.0.0
// with pug template engine installed 2016-03-21
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync';
import del from 'del';
import pug from 'gulp-pug';
import {stream as wiredep} from 'wiredep';
@gabovanlugo
gabovanlugo / ai-export-artboard-assets.jsx
Created April 12, 2016 22:01
Adobe Illustrator Script for exporting artboards to a selective density assets.
/**
* Remix by: @gabovanlugo (http://gabolugo.com)
* Thanks to: @herkulano, Niels Bosma & Hiroyuki Sato
*/
main();
var folder;
@gabovanlugo
gabovanlugo / CustomButton.swift
Created February 24, 2016 17:29 — forked from soggybag/CustomButton.swift
Custom Designable, Inspectable button with border and corner radius.
import UIKit
@IBDesignable
class CustomButton: UIButton {
@IBInspectable var borderColor: UIColor? = UIColor.clearColor() {
didSet {
layer.borderColor = self.borderColor?.CGColor
}
}
@IBInspectable var borderWidth: CGFloat = 0 {
@gabovanlugo
gabovanlugo / txt
Created October 28, 2015 20:30
UUID Swift
5B1C1F3E-873A-4FCA-B35C-BAB4D32AD79E
780DCC74-FB07-4709-89C4-375C91888A3E
67A330BE-61B3-4B50-AFB3-D533F55A4FE1
8E902976-2731-4601-972F-FAA0A7FF83D7
4978FE4E-184B-4F50-B729-A68A89C8B224
A6145B83-07C7-4115-831E-A7F89B8BD947
F509B0E7-29F1-4578-82D2-5717E59C14F3
0921BD23-90CF-4FB2-9406-1B8AB492B5E3
2A73A539-03AE-4588-BAAB-4B1BB8F6CB68
F55A238C-5D26-4B7D-849F-7E25CED57F81
@gabovanlugo
gabovanlugo / Alamofire-SwiftyJSON.swift
Created September 15, 2015 12:20
Alamofire-SwiftyJSON Swift 2.0
//
// AlamofireSwiftyJSON.swift
// AlamofireSwiftyJSON
//
// Created by Pinglin Tang on 14-9-22.
// Copyright (c) 2014 SwiftyJSON. All rights reserved.
//
import Foundation
@gabovanlugo
gabovanlugo / firstLetterUppercase
Last active August 29, 2015 14:05
Uppercase first letter
firstLetterUppercase = yourString.charAt(0).toUpperCase()+yourStrings.ubstring(1)
@gabovanlugo
gabovanlugo / mobile-agent
Created June 27, 2013 15:34
Check if your user is using an iOS or Android Device.
var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");
var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");
var isiPod = navigator.userAgent.toLowerCase().indexOf("ipod");
var isAndroid = navigator.userAgent.toLowerCase().indexOf("android");
if(isiPhone > -1 || isiPad > -1 || isiPod > -1 || isAndroid > -1){
// Do your mobile-only stuff
console.log("You're in a mobile device son ;)");
}