This file contains 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
def findPrimes(toInt: Int): Seq[Int] = { | |
def eras(l: Seq[Int]): Seq[Int] = { | |
val size = l.size | |
val mlist = collection.mutable.IndexedSeq(l:_*) | |
def crossout(x: Int): Unit = { | |
def crossout(xbase: Int, x: Int):Unit = { | |
if (x<size) { | |
mlist(x) = 0 |
This file contains 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
## ============================================= | |
# peek on gms service | |
adb -s emulator-5554 shell dumpsys activity service GcmService --endpoints <package> | |
## ============================================= | |
# MITM | |
MY_IP=$(ifconfig wlan0 | sed -rn 's/.*inet addr:(.+) Bcast:.*/\1/p') | |
mitmproxy -i $MY_IP -p 8888 | |
# proxy enabled emulators | |
/home/fada21/Android/Sdk/tools/emulator -netdelay none -netspeed full -avd Nexus_5X_API_23 -http-proxy localhost:8888 |
This file contains 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
# use like ./certs.sh www.google.com | |
#!/bin/bash | |
certs=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n '/Certificate chain/,/Server certificate/p'` | |
rest=$certs | |
while [[ "$rest" =~ '-----BEGIN CERTIFICATE-----' ]] | |
do | |
cert="${rest%%-----END CERTIFICATE-----*}-----END CERTIFICATE-----" | |
rest=${rest#*-----END CERTIFICATE-----} | |
echo `echo "$cert" | grep 's:' | sed 's/.*s:\(.*\)/\1/'` |
This file contains 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
DEFAULT_API_VERSION=`cat dockerImageSha` | |
if [ ! -z $1 ] ; then echo "setting API_VERSION to $1"; else echo "API_VERSION not set, using default: $DEFAULT_API_VERSION"; fi | |
API_VERSION=${1:-$DEFAULT_API_VERSION} | |
export API_VERSION | |
echo "API_VERSION set to $API_VERSION" |
This file contains 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
# gitconfig with aliases | |
cat > ~/.gitconfig << EOF | |
[alias] | |
list = !git config -l | grep alias | cut -c 7- | |
up = fetch | |
st = status | |
br = branch | |
brn = !git rev-parse --abbrev-ref HEAD | |
brd = branch -D | |
co = checkout |
This file contains 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 test | |
import io.reactivex.Observable | |
import io.reactivex.observers.TestObserver | |
import io.reactivex.rxkotlin.toObservable | |
import org.junit.Before | |
import org.junit.Test | |
class EndlessStreamWithListsToFilterKotlinTest { | |
val list1 = listOf(1, 2, 3, 4) |
This file contains 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 com.fada21.android | |
import android.graphics.Bitmap | |
import android.graphics.BitmapFactory | |
import android.graphics.Matrix | |
import androidx.exifinterface.media.ExifInterface | |
import java.io.File | |
import java.io.FileInputStream | |
import java.io.IOException |
OlderNewer