Skip to content

Instantly share code, notes, and snippets.

View sergii-frost's full-sized avatar
💭
¯\_(ツ)_/¯

Sergii sergii-frost

💭
¯\_(ツ)_/¯
  • Stockholm, Sweden
View GitHub Profile
/*
* Copyright 2012 AndroidPlot.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@sergii-frost
sergii-frost / iOS Jenkins job
Created November 22, 2013 14:44
Example of commong iOS Jenkins job to build and upload app to TestFlight
function fail {
echo "$*" >&2
exit 1
}
#!/usr/bin/env bash
source ~/.bash_profile
#hack to add Mercurial to PATH
export PATH=$PATH:/usr/local/bin
@sergii-frost
sergii-frost / FontUtils.java
Last active December 31, 2015 15:09
Gist to set custom font to all textviews and buttons in viewgroup
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
public class FontUtils {
public static Typeface getOpenSansLight(AssetManager am) {
#!/bin/bash
### Function to get UUID from .mobileprovision file
### $1 - .mobileprovision file to get UUID for
function get_uuid() {
uuid=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i "$1")`
echo $uuid
}
### Go through all provisioning profiles and just echo their uuids
@sergii-frost
sergii-frost / Frosts Podfile
Created July 16, 2014 15:31
Frost Podfile Template
### Useful cocoapods to be included into different projects
### NOTE: Always specify version for each of plugins, otherwise they can be updated silently and break the code
### More about cocoapods: http://cocoapods.org
### Most pods do have docs: http://cocoadocs.org
### Most used pods: http://www.reigndesign.com/cocoapodsleaderboard/
###========================================
### UTILITIES
@sergii-frost
sergii-frost / AFNetworkingClient.m
Last active August 29, 2015 14:06
AFNetworkingClient + Retry logics
//
// AFNetworkingClient+Retry
//
// Created by Sergii Nezdolii on 2014-09-23.
//
//
@interface AFNetworkingClient : NSObject
@property (strong, readonly) AFHTTPRequestOperationManager *manager;
@sergii-frost
sergii-frost / Example.m
Last active August 29, 2015 14:07
Example of using SDWebImage
- (UIImage *)userImage
{
UIImage *cachedImage = nil;
NSString *imagePath = self.imageFilename;
if (imagePath)
{
SDWebImageManager *manager = [SDWebImageManager sharedManager];
NSURL *imageURL = [NSURL URLWithString:imagePath];
@sergii-frost
sergii-frost / git-flow tips.md
Last active August 29, 2015 14:07
Git Flow tips and tricks
  • Having at least 2 branches: master and develop
  • master branch has only released code
  • develop branch has only stable code
  • When working on new feature it is better to create brunch like:
> git checkout -b develop-my-new-cool-feature
  • After work on feature in separate branch is done, it is better to merge it with develop (as other developers could push their features there):
> git merge develop
@sergii-frost
sergii-frost / iOS8ViewController.m
Created October 28, 2014 14:01
iOS 8 fix to support old methods of device orientation changes
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
//The device has already rotated, that's why this method is being called.
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
//fixes orientation mismatch (between UIDeviceOrientation and UIInterfaceOrientation)
UIInterfaceOrientation toOrientation;
switch (deviceOrientation) {
case UIDeviceOrientationUnknown:
toOrientation = UIInterfaceOrientationUnknown;
@sergii-frost
sergii-frost / AndroidAndHockeyApp.gradle
Created December 9, 2014 09:26
build.grade file with HockeyApp plugin configuration and helpful groovy method to get git notes
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'de.felixschulze.gradle:gradle-hockeyapp-plugin:2.4'
}
}