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
@manishpathak99
manishpathak99 / floatsign.sh
Last active September 7, 2015 09:41 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@manishpathak99
manishpathak99 / gist:080dbb38c3c77b7c44e0
Created December 11, 2015 14:06 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@manishpathak99
manishpathak99 / usefull_openEDX_commands
Created December 11, 2015 14:08
OPen EDX Commands
sudo /edx/bin/supervisorctl
restart edxapp: edxapp_worker:
@manishpathak99
manishpathak99 / repo_history_writer.sh
Created December 31, 2015 02:30
Script to copy GIT history from one repo to another newly created repo.
# Step 1
usage ()
{
echo 'This script is used to copy the code history of one repository to another repository'
echo 'Please provide the parameters as below'
echo 'Usage : Script <SOURCE_REPO_URL> <DST_REPO_URL> <source_repo_name> <dest_repo_name>'
exit
}
@manishpathak99
manishpathak99 / SVN_To_GIT_Migration.sh
Created January 2, 2016 00:15
This script migrated the svn repo to git repo.(Script to copy SVN history to GIT history).
usage ()
{
echo 'This script is used to migrate the SVN repo to GIT repo'
echo 'Please provide the parameters as below'
echo 'Usage : Script <SVN_REPO_URL> <GIT_REPO_URL>'
echo 'Usage : Script http://10.42.0.54/mysvn/myrepo/SocialShare git@github.com:manishpathak99/socialshare.git'
exit
}
if [ "$#" -ne 2 ]
@manishpathak99
manishpathak99 / GooglePlayServiceUtil.java
Last active May 5, 2016 09:25
Check Google Play Service Lolipop
public class GooglePlayServiceUtil {
private static final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000;
/**
* Use this method in onCreate method of activity
*
* Check the device to make sure it has the Google Play Services APK. If
* it doesn't, display a dialog that allows users to download the APK from
* the Google Play Store or enable it in the device's system settings.
@manishpathak99
manishpathak99 / Reduce_apk_size.txt
Last active June 15, 2016 11:17
Steps to reduce the apk size.
1- reduce the other's language strings in string.xml
add below in build.gradle-
defaultConfig {
resConfigs "en"
}
2- unzip the final apk, go to res directory, run the below commamd to know the size of resfiles in descending order.
find . -type f -exec ls -al {} \; | sort -nr -k5 | head -n 25
# Optimize logging away from release builds
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** i(...);
public static *** e(...);
public static *** w(...);
public static *** wtf(...);
public static *** isLoggable(...);
@manishpathak99
manishpathak99 / README.md
Created December 27, 2016 12:24 — forked from Coeur/README.md
Write to NTFS on OSX Yosemite and El Capitan

Install osxfuse (3.x.x) from https://github.com/osxfuse/osxfuse/releases.

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Update Homebrew formulae:

brew update
@manishpathak99
manishpathak99 / AlamofirePrintable.swift
Last active June 6, 2017 13:59
Print JSON response on console using ALAMOFIRE swift 3.0+
import Foundation
import Alamofire
extension Alamofire.DataRequest {
func responseDebugPrint() -> Self {
return responseJSON() {
response in
if let JSON = response.result.value,
let JSONData = try? JSONSerialization.data(withJSONObject: JSON, options: .prettyPrinted),
let prettyString = NSString(data: JSONData, encoding: String.Encoding.utf8.rawValue) {