Skip to content

Instantly share code, notes, and snippets.

View manishpathak99's full-sized avatar
💭
Worked with iOS/Android/AWS. Technology Geek ##@@##

Manish Pathak manishpathak99

💭
Worked with iOS/Android/AWS. Technology Geek ##@@##
View GitHub Profile
@null-loop
null-loop / savemp3.m
Last active December 19, 2015 22:18
Saving MP3 to Documents folder in iOS
- (IBAction)saveRingtoneButtonClicked:(UIButton *)sender {
m_saveRingtoneButtonLowlighted = false;
m_saveRingtoneButtonHighlighted = true;
[self animateSaveRingtoneButton];
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,true);
NSString* sourceFilePath = [[NSBundle mainBundle] pathForResource:[m_activeClip.mp3 componentsSeparatedByString:@"."][0] ofType:@"mp3"];
NSData* mainBundleFile = [NSData dataWithContentsOfFile:sourceFilePath];
@rafaelloab
rafaelloab / gist:7558002
Last active December 28, 2015 20:29
Steps to generate App Engine Backend in Android Studio
useful links
http://bradabrams.com/2013/06/google-io-2013-demo-android-studio-cloud-endpoints-synchronized-stopwatch-demo/
http://android-developers.blogspot.com.br/2013/06/adding-backend-to-your-app-in-android.html
https://code.google.com/p/gcm/
https://github.com/bradabrams/stopwatchio13
https://developers.google.com/appengine/docs/java/endpoints/getstarted/backend/configure_pom
http://developer.android.com/google/gcm/index.html
https://developers.google.com/events/io/sessions/324893448
Android Studio 0.3.5
@tkhduracell
tkhduracell / colors.xml
Created March 21, 2015 17:31
Material Colors
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="primary">#673AB7</color>
<color name="primary_dark">#512DA8</color>
<color name="primary_light">#D1C4E9</color>
<color name="accent">#FF4081</color>
<color name="text_primary">#FFFFFF</color>
<color name="text_secondary">#727272</color>
<color name="icons">#FFFFFF</color>
@ashleymills
ashleymills / UIApplication+AppVersion
Created June 18, 2015 13:24
UIApplication category to get app version / build
@implementation UIApplication (AppVersion)
+ (NSString *) appVersion
{
return [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"];
}
+ (NSString *) build
{
return [[NSBundle mainBundle] objectForInfoDictionaryKey: (NSString *)kCFBundleVersionKey];
@tomkowz
tomkowz / custom-stirng-convertible.swift
Last active January 19, 2018 10:20
CustomStringConvertible
struct Position {
var x: Int = 0
var y: Int = 0
func string() -> String {
return "(\(x), \(y))"
}
}
// CustomStringConvertible provides "description" property.
@giljulio
giljulio / GsonRequest.java
Last active April 1, 2019 18:21
Volley implementation of Gson Request
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.HttpHeaderParser;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
@j0d5
j0d5 / .swiftlint.yml
Created October 24, 2017 05:37
Swiftlint configuration file
included:
excluded:
- Pods
- Cartography
- build
disabled_rules: # rule identifiers to exclude from running
# - cyclomatic_complexity
- trailing_whitespace
@melanke
melanke / MLRoundedImageView.java
Created October 25, 2013 17:19
Android Rounded Image
public class MLRoundedImageView extends ImageView {
public MLRoundedImageView(Context context) {
super(context);
}
public MLRoundedImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@srivastavarobin
srivastavarobin / AndroidJavaCodeReview.md
Last active August 4, 2023 10:32
Code Review Checklist for Android (Java Only)

My Android Java Code Review Checklist

  1. Is the functionality correct?
  2. Are the classes named suitably?
  3. Are the functions named suitably?
  4. How's the datastructure being used? Is it the correct DS or it needs improvement?
  5. Can the classes be further borken into small classes?
  6. Do we need an interface?
  7. If it contain functions that can be reused later then are there Utils created for them?
  8. Can it use already available Util functions?
  9. Does the large set of input for a function deserve a new bean to be created?
#!/usr/bin/ruby
=begin
#### DIRECTIONS ####
Run `/usr/bin/ruby savings.rb <path to executable>`, and it will report the estimated savings for that executable.
*However*, the executable cannot have been downloaded from the app store (or else it will already be the encrypted version, and we can't unencrypt it to calculate the savings)
Also, it should be a binary for a specific architecture, and not a fat binary. I'd assume arm64 would be way to go.
How to get an arm64 binary that is not encrypted?
Run Product -> Archive in Xcode, then export the app Ad Hoc, and for the device to thin for, select a device with arm64 (an iPhone 5s or above)
Unzip the .ipa file that was exported, and Payload/<app name>.app/<app name> should be the executable that you want