Skip to content

Instantly share code, notes, and snippets.

@PuKoren
PuKoren / digicert_to_aws.sh
Created January 10, 2015 14:20
Upload Digicert certificate to Amazon Web Services (AWS)
#!/bin/sh
# $1: certificate name on AWS
# $2: certificate file (crt)
# $3: private key file (pem)
# $4: DigicertCA2 path
# $5: TrustedRoot path
# Download certificates on Digicert (Other formats > Individual crt files with a .cer extension)
# Generate intermediate cert for AWS (not an option, many browsers requires it it). Intermediate is concatenation of CA and Root certs
(openssl x509 -inform PEM -in $4; openssl x509 -inform PEM -in $5) > Intermediate.cer
@PuKoren
PuKoren / AWS_deploy.sh
Created January 14, 2015 16:28
Travis script used to deploy on AWS ElasticBeanstalk (inspired from Codeship's one)
#!/bin/bash
# v0.0.2
# AWS Deploy Script for Travis
# Remember to add the env var in the travis configuration
# in order to work, this scripts needs:
# AWS_ACCESS_KEY_ID: user ID
# AWS_SECRET_ACCESS_KEY: user secret
# APP_NAME: EBS application name
# APP_ENV: EBS application env
# S3_BUCKET: name of the S3 bucket to store deployment archive
@PuKoren
PuKoren / random.js
Created March 16, 2015 10:56
[JS] Random Integer function
var getRandomInt = function (max, min) {
min = min || 0;
return Math.floor((Math.random() * (max - min)) + min);
};
@PuKoren
PuKoren / run.sh
Created March 17, 2015 14:16
Build, upload and run Android app
./gradlew assembleDebug
adb -d install -r sample/build/outputs/apk/*.apk
adb shell am start -n com.package.name/com.package.name.MainActivity
@PuKoren
PuKoren / codeship_android_build.sh
Last active February 1, 2024 19:35 — forked from mlocher/install_android_sdk.sh
Codeship Android build script
cd /tmp
pwd
#Download Android SDK from Google and unzip it
wget http://dl.google.com/android/android-sdk_r24.1.2-linux.tgz
tar zxvf android-sdk_r24.1.2-linux.tgz
rm android-sdk_r24.1.2-linux.tgz
#Set extracted SDK location to $PATH so we can use commands
export ANDROID_HOME="/tmp/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
@PuKoren
PuKoren / recompile-and-run.sh
Last active May 31, 2024 15:18
Recompile APK + Sign with apktool
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@PuKoren
PuKoren / index.html
Created April 12, 2017 17:04
Properties, does it count ? (https://jsbench.github.io/#bbb3b3868ab5b99bb33b0bf9b6385b1b) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Properties, does it count ?</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@PuKoren
PuKoren / index.html
Created April 12, 2017 17:08
Properties, does it count ? (https://jsbench.github.io/#ff51f42de8ccbf82476980bfdf905410) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Properties, does it count ?</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>