This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installing Git | |
sudo apt install git | |
# Update the local packages | |
sudo apt-get update | |
sudo apt full-upgrade | |
# Installing docker | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package your.package.name.here; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
import org.springframework.web.client.RestTemplate; | |
@Configuration | |
public class RestConfiguration { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pgloader --no-ssl-cert-verification mysql://{USER}:{PASSWORD}@{HOST}:3306/{DB_NAME} {HEROKU_DB_URL}?sslmode=require |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const endpoints = ["/businesses/:businessId/banks/:bankInfoId" ,"/businesses/mine/banks/:bankInfoId"] //,"/businesses/sales/:businessId/banks/:bankInfoId","/publicnotifications/:publicNotificationId","/publicnotifications/:userPublicNotificationId","/pushtokens","/users/me/phones/:userPhoneId","/accounting/businesses/:businessId/summary","/accounting/migrate/payables","/accounting/migrate/paymentmetainfo","/accounting/orders/:orderId","/accounting/orders/:orderRefId","/accounting/paid","/accounting/paid/summary","/accounting/payables","/accounting/payables/summary","/accounting/receivables","/accounting/receivables/:accountReceivableId/refundbreakdown","/accounting/receivables/summary","/accounting/received","/accounting/received/summary","/accounting/withdraws","/accounting/withdraws/:withdrawRequestId","/accounting/withdraws/summary","/acl/register","/acl/routes","/activitylogs","/activitylogs/:activityLogId","/addons/:addonId","/analytics","/analytics/businesses/mine","/analytics/businesses/mine/custom/ord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Base model | |
function BaseModel() { | |
} | |
BaseModel.prototype.difference = function(latestModel, arrDiffActual = false) { | |
const difference = {}; | |
const self = this; | |
Object.keys(this).forEach( function(key) { | |
if(self[key] instanceof BaseModel) { | |
// kind of another base model | |
const keyValueDifference = self[key].difference(latestModel[key]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIViewController { | |
@objc func analytics() { | |
print("Analytics related implementation") | |
analytics() | |
} | |
static func swizzle() { | |
// We will swizzle here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
extension String { | |
func getQueryValue(param: String) -> String? { | |
return URLComponents(string: self)?.queryItems?.filter({ (queryItem) -> Bool in | |
return queryItem.name == param | |
}).first?.value | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Here it is assumed that you are in osx/linux/windows environment | |
# and you have already installed python3 | |
# | |
# | |
# Creating a virtual environment | |
# | |
# osx/linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UITextView { | |
func wrapToContent() { | |
self.contentInset = UIEdgeInsets.zero | |
self.scrollIndicatorInsets = UIEdgeInsets.zero | |
self.contentOffset = CGPoint.zero | |
self.textContainerInset = UIEdgeInsets.zero | |
self.textContainer.lineFragmentPadding = 0 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// URL+PercentEncoding.swift | |
// | |
// Created by ratul sharker on 4/4/18. | |
// | |
import Foundation | |
extension URL { | |
static func initWithPercentEncoding(string : String) -> URL? { |
NewerOlder