Dear iOS Developer,
These are the things you might take into account when developing rock-solid iOS apps.
Writing better code makes you happy and will make your employer, teammates, and even customers happier in the mid-long term.
import Foundation | |
import UIKit | |
import ImageIO | |
import MobileCoreServices | |
extension UIImage { | |
static func animatedGif(from images: [UIImage]) { | |
let fileProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFLoopCount as String: 0]] as CFDictionary | |
let frameProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [(kCGImagePropertyGIFDelayTime as String): 1.0]] as CFDictionary | |
// Based on https://gist.github.com/appsbynight/3681050 by Matt Di Pasquale | |
// Author: Victor Corvalan | |
// http://twitter.com/pescadon | |
// This script will generate squares and wide Icons & Tiles required for Windows Store build on Unity3D | |
// Prepare 1 big icon of 512x512px | |
// Open this script with Photoshop -> File -> Scripts -> Browse | |
// Load your icon when prompted | |
var destFolder; | |
try |
import requests | |
from bs4 import BeautifulSoup | |
from subprocess import call | |
import sys | |
# Script to download and decompile an apk using the package name. | |
# Install the jadx decompiler before running this. | |
# | |
# JADX installation : | |
# $ git clone https://github.com/skylot/jadx.git |
#!/bin/bash | |
DEFAULT_URL=http://updates.jenkins-ci.org/current/latest/jenkins.war | |
TMP_PATH=/tmp/jenkins.war | |
APP_PATH=/Applications/Jenkins/jenkins.war | |
PLIST_PATH=/Library/LaunchDaemons/org.jenkins-ci.plist | |
url=${1-$DEFAULT_URL} | |
echo 'Downloading WAR package...' |
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import com.squareup.picasso.Transformation; | |
public class CircleTransform implements Transformation { | |
private final int BORDER_COLOR = Color.WHITE; |
package com.github.manuelpeinado.toolbartest; | |
import android.graphics.Color; | |
import android.graphics.drawable.Drawable; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.support.v7.widget.Toolbar; | |
import android.view.Menu; | |
import android.view.View; |
import android.graphics.*; | |
import com.squareup.picasso.Transformation; | |
/** | |
* Transforms an image into a circle representation. Such as a avatar. | |
*/ | |
public class CircularTransformation implements Transformation | |
{ | |
int radius = 10; |
package nilzor.public.views; | |
import android.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.widget.ImageView; | |
public class ScalingImageView extends ImageView { | |
private boolean mAdjustViewBounds; |
#import <Foundation/Foundation.h> | |
@interface NSObject (NSDictionaryRepresentation) | |
/** | |
Returns an NSDictionary containing the properties of an object that are not nil. | |
*/ | |
- (NSDictionary *)dictionaryRepresentation; | |
@end |