Skip to content

Instantly share code, notes, and snippets.

View PauloMigAlmeida's full-sized avatar
🏄‍♂️

Paulo Miguel Almeida PauloMigAlmeida

🏄‍♂️
View GitHub Profile
@PauloMigAlmeida
PauloMigAlmeida / ConvertImageToIphoneSize
Last active August 29, 2015 13:55
Converting Images from Android xhdpi to Iphone 1x And 2x
#!/bin/bash
# Script's goals
#
# 1 - Trim image
# 2 - Create folder for exported ones
# 3 - Convert proportionally
#
# Script usage
@PauloMigAlmeida
PauloMigAlmeida / UILabel+UtilityAttributes.h
Created February 3, 2014 13:18
UILabel Util Categories for day-to-day use
//
// UILabel+UtilityAttributes.h
//
// Created by Paulo Almeida on 1/31/14.
//
#import <UIKit/UIKit.h>
@interface UILabel (UtilityAttributes)
@PauloMigAlmeida
PauloMigAlmeida / UIImageView+WebCacheWithActivityIndicator.h
Created February 4, 2014 00:54
UIImageView Category to show an activity indicator when downloading images form internet using SDWebImage
//
// UIImageView+WebCacheWithActivityIndicator.h
//
// Created by Paulo Miguel Almeida on 2/3/14.
//
#import <UIKit/UIKit.h>
#import <SDWebImage/UIImageView+WebCache.h>
@PauloMigAlmeida
PauloMigAlmeida / DateUtils.h
Created February 8, 2014 18:38
Utility methods for dealing with Date objects in Object C
//
// DateUtils.h
//
// Created by Paulo Miguel Almeida on 2/8/14.
//
#import <Foundation/Foundation.h>
@interface DateUtils : NSObject
@PauloMigAlmeida
PauloMigAlmeida / AppDelegate.m
Last active August 29, 2015 13:56
Steps to make you app and database work with utf8mb4 characters in order to accept emojis. It's based on a webapp using Maven+Hibernate+Spring+Jetty+MySQL
//
// AppDelegate.m
//
// Created by andre.michels on 12/3/13.
//
#import "AppDelegate.h"
#import "NetworkAvailabilityUtils.h"
@implementation TableViewHistoryAppDelegate
@PauloMigAlmeida
PauloMigAlmeida / UIView+LoadingWithActivityIndicator.h
Created February 12, 2014 00:03
UIView Category which hides every component inside and shows up an activityIndicator while you do things in background
//
// UIView+LoadingWithActivityIndicator.h
//
// Created by Paulo Miguel Almeida on 2/11/14.
// Copyright (c) 2014 Paulo Miguel Almeida. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (LoadingWithActivityIndicator)
@PauloMigAlmeida
PauloMigAlmeida / gist:8974648
Created February 13, 2014 12:59
Compiling OpenNI and libfreenect to get Kinect for XBOX 360 working on Fedora 17
#References
#
#http://schnelle-walka.blogspot.com.br/2013/04/openni-20-with-fedora-18.html
#https://github.com/OpenKinect/libfreenect#fetch-build
# A couple of threads on StackOverflow but unfortunately I can't remember all of them
#Install Dependencies:
yum install libXmu-devel libudev-devel libusb1-devel mesa-libGLU-devel freeglut-devel freeglut-devel cmake
@PauloMigAlmeida
PauloMigAlmeida / GenerateImage.java
Created June 18, 2014 15:01
Class used to create a bunch of images with random colors for later use
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.color.ColorSpace;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;
/**
* Class used to create a bunch of images with random color for later use
@PauloMigAlmeida
PauloMigAlmeida / Makefile
Created February 18, 2015 21:31
OpenCV CascadeClassifier example for face detection
# Makefile
ifeq ($(shell pkg-config --modversion opencv),)
$(error Package gtkmm-2.4 needed to compile)
endif
CXXFLAGS += `pkg-config --cflags opencv`
LDLIBS += `pkg-config --libs opencv`
BINS = program
program_OBJS = main.o
@PauloMigAlmeida
PauloMigAlmeida / download.sh
Created July 28, 2015 20:57
Downlads today's files from a AWS S3 bucket
#/bin/bash
# Usage ./download.sh <bucket_name> <target_folder>
# Example: ./download.sh test ./files_today
# Note: you must configure your awscli before use this. Execute aws configure
BUCKET_NAME=$1
TARGET_DIR=$2
FILES_LIST=$TARGET_DIR/files.txt