Skip to content

Instantly share code, notes, and snippets.

View oxlb's full-sized avatar
🎯
Focusing

Onexlab (Munish Kapoor) oxlb

🎯
Focusing
View GitHub Profile
@oxlb
oxlb / aws_mfa_security.json
Last active January 1, 2019 08:45
AWS MFA Security
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowAllUsersToListAccounts",
"Effect": "Allow",
"Action": [
"iam:ListAccountAliases",
"iam:GetAccountPasswordPolicy",
"iam:ListUsers",
@oxlb
oxlb / assume_admin_rule.json
Last active January 1, 2019 05:48
Assume Admin Rule
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": [
@oxlb
oxlb / handler.js
Last active January 13, 2019 16:58
Serverless framework env conf example
'use strict';
const connection = {
client: 'mysql',
connection: {
host : process.env.HOST,
user : process.env.USER,
password : process.env.PASSWORD,
database : process.env.DATABASE
},
pool: { min: 1, max: 10 },
@oxlb
oxlb / main.go
Created March 9, 2019 22:33
echo framework URL based versioning
package main
import (
"net/http"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
e.GET("v1/todo", func(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
@oxlb
oxlb / main.go
Created March 9, 2019 23:01
echo framework header based versioning
package main
import (
"net/http"
"fmt"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
@oxlb
oxlb / adEvent.swift
Created October 16, 2019 06:37
Events Enums for Google Ads Tracking
enum adEvent {
case viewAdInt
case viewAdBanner
func getName() -> String {
switch self {
case .viewAdInt:
return "view_ad_int"
case .viewAdBanner:
return "view_ad_banner"
}
@oxlb
oxlb / adType.swift
Created October 16, 2019 07:01
adType for the type of ads
enum adType: Int {
case banner
case interstitial
func getName() -> String {
switch self {
case .banner:
return adEvent.getName(.viewAdBanner)()
case .interstitial:
return adEvent.getName(.viewAdInt)()
@oxlb
oxlb / AdAnalyticsModel.swift
Created October 16, 2019 07:09
AdAnalyticsModel class for Google ads
class AdAnalyticsModel {
func trackAd(typeOfAd: adType, adUnitId: String?) {
if let adId = adUnitId {
print("adUnitId ", adId)
}
print("adType \(typeOfAd.getName())")
}
}
AppsFlyerLib.getInstance().registerConversionListener(this, new AppsFlyerConversionListener() {
/* for deferred deep linking */ @Override
public void onConversionDataSuccess(Map<String, String> conversionData) {
for (String attrName : conversionData.keySet()) {
Log.d(AppsFlyerLib.LOG_TAG, "conversion_attribute: " + attrName + " = " +
conversionData.get(attrName));
}
}
@Override
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, AppsFlyerTrackerDelegate{
// ...
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
AppsFlyerTracker.shared().appsFlyerDevKey = "repLaceWithYourDevKeY"
AppsFlyerTracker.shared().appleAppID = "123456789"
// ...