Skip to content

Instantly share code, notes, and snippets.

@manishkpr
manishkpr / fastlane_beta.ruby
Created November 21, 2019 03:08 — forked from monday8am/fastlane_beta.ruby
Fastlane Beta
desc ""
lane :beta do |lane|
# ensure you are in master branch
ensure_git_branch
# ensure that master branch is clean
ensure_git_status_clean
# check the semantic parameter entered
@manishkpr
manishkpr / osx-kong.sh
Created June 12, 2018 01:54 — forked from sepehr/osx-kong.sh
OSX: Kong Installation
#!/bin/bash
#
# The homebrew formula of kong has a lot of version incompatibilities. So
# we install kong directly from Luarocks.
#
# Kong only works with Cassandra 2.1.x/2.2.x, the latest brew formula for
# cassandra is 3.x. We need to tap homebrew/versions and install cassandra22
# instead.
#
@manishkpr
manishkpr / server_certificates_to_pem.md
Created April 23, 2018 05:42 — forked from stevenhaddox/server_certificates_to_pem.md
Convert .crt & .key files into .pem file for HTTParty

Two ways to do it, but only worked for me so I'll put it first and the second for reference:

$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -out hostname.p12
$ openssl pkcs12 -in hostname.p12 -nodes -out hostname.pem

Other options for this method in comments below:

# Note, the -certfile root.crt appends all CA certs to the export, I've never needed these so it's optional for my personal steps
$ openssl pkcs12 -export -in hostname.crt -inkey hsotname.key -certfile root.crt -out hostname.p12

Note, I've always had my hostname.crt as part of my .pem, so I keep my certs but apparently you may not have to, hence the nocerts flag being an extra option in this sample

@manishkpr
manishkpr / async_waterfall_example.js
Last active May 26, 2017 03:17 — forked from dineshsprabu/async_waterfall_example.js
NodeJS Async WaterFall Example
var async = require('async');
async.waterfall(
[
function(callback) {
callback(null, 'Yes', 'it');
},
function(arg1, arg2, callback) {
var caption = arg1 +' and '+ arg2;
callback(null, caption);
@manishkpr
manishkpr / Foreground.java
Created February 28, 2017 06:45 — forked from steveliles/Foreground.java
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@manishkpr
manishkpr / CustomSnackbar.java
Created February 6, 2017 09:02 — forked from raphaelbussa/CustomSnackbar.java
Helper for inflate custom layout in google support design snackbar
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Raphaël Bussa
*
* 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 Software is
@manishkpr
manishkpr / OnItemSelectedListener.java
Created December 27, 2016 06:51 — forked from andreynovikov/OnItemSelectedListener.java
Complete working solution for Android action bar tabs with fragments having separate back stack for each tab.
// Custom interface that enables communication between Fragment and its Activity
public interface OnItemSelectedListener
{
public void onItemSelected(String item);
}
@manishkpr
manishkpr / ControllableAppBarLayout.java
Created August 2, 2016 08:28 — forked from blipinsk/ControllableAppBarLayout.java
An extension of Android AppBarLayout, that allows to programatically change the CollapsibleToolbarLayout state
/**
* Copyright 2015 Bartosz Lipinski
*
* 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
@manishkpr
manishkpr / UIActivity.java
Created February 23, 2016 09:57 — forked from chris95x8/UIActivity.java
FAB expand
package com.materialdesign.chris.materialdesignexperimenting;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.ViewAnimationUtils;
/*
* Copyright 2014 Chris Banes
*
* 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