Skip to content

Instantly share code, notes, and snippets.

View yaml_3_containers.yaml
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ template "fullname" . }}
namespace: "{{ .Values.namespace }}"
labels:
chart: "chartNameVersion"
spec:
serviceName: {{ template "fullname" . }}
replicas: {{ .Values.replicaCount }}
View sample.yaml
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ template "fullname" . }}
namespace: "{{ .Values.namespace }}"
labels:
chart: "chartNameVersion"
spec:
serviceName: {{ template "fullname" . }}
replicas: {{ .Values.replicaCount }}
@a-v-ebrahimi
a-v-ebrahimi / add_aar_to_gradle
Created Mar 23, 2016
Add AAR Library to build.gradle
View add_aar_to_gradle
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
dependencies {
View Android APK Name
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.company.app"
minSdkVersion 13
targetSdkVersion 21
versionCode 14 // increment with every release
versionName '1.4.8' // change with every release
setProperty("archivesBaseName", "MyCompany-MyAppName-$versionName")
@a-v-ebrahimi
a-v-ebrahimi / center_align_vertically.css
Created Feb 11, 2016
Center align a block vertically in CSS
View center_align_vertically.css
.center-align-vertically {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
@a-v-ebrahimi
a-v-ebrahimi / copypath
Created Aug 5, 2015
Copy path to clipboard (Automator)
View copypath
on run {input, parameters} try
tell application "Finder" to set the clipboard to POSIX path of (target of window 1 as alias)
on error
beep
end try return input end run
@a-v-ebrahimi
a-v-ebrahimi / gradle_apk_name
Last active Aug 29, 2015
Android Gradle APK name
View gradle_apk_name
buildTypes {
release {
//...
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(
output.outputFile.parent,
output.outputFile.name.replace("app-release.apk", "YOURAPPNAME-${variant.versionName}.apk"))
}
}
@a-v-ebrahimi
a-v-ebrahimi / gist:283c723b7eae8b42730e
Created Feb 9, 2015
Convert LinkedTreeMap key-value pair into JSON
View gist:283c723b7eae8b42730e
public static JSONObject convertKeyValueToJSON(LinkedTreeMap<String, Object> ltm) {
JSONObject jo=new JSONObject();
Object[] objs = ltm.entrySet().toArray();
for (int l=0;l<objs.length;l++)
{
Map.Entry o= (Map.Entry) objs[l];
try {
if (o.getValue() instanceof LinkedTreeMap)
jo.put(o.getKey().toString(),convertKeyValueToJSON((LinkedTreeMap<String, Object>) o.getValue()));
else
@a-v-ebrahimi
a-v-ebrahimi / gist:22b55e9eb8087c9c85d1
Created Sep 1, 2014
Check if user is elevated (UAC)
View gist:22b55e9eb8087c9c85d1
// copied from :
// http://stackoverflow.com/a/17492949/305135
public static class UacHelper
{
private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
private const string uacRegistryValue = "EnableLUA";
private static uint STANDARD_RIGHTS_READ = 0x00020000;
private static uint TOKEN_QUERY = 0x0008;