Skip to content

Instantly share code, notes, and snippets.

@amanjain08
amanjain08 / 1_kubernetes_on_macOS.md
Created November 27, 2018 19:07 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@amanjain08
amanjain08 / kafka-command.md
Created September 20, 2018 09:13 — forked from pkafel/kafka-command.md
Kafka command-line tools (examples in OSX)

Kafka command line tools

List (not complete)

  • zookeeper-server-start.sh - starting Zookeeper
  • kafka-server-start.sh - start Kafka
  • kafka-topics.sh - manage topics in Kafka
  • kafka-console-producer.sh - script for sending messages to Kafka topic
  • kafka-console-consumer.sh - script for consuming messages from Kafka topic
  • kafka-run-class.sh - script for running different tools (list of tools can be found here)
@amanjain08
amanjain08 / Android.mk
Created May 24, 2018 19:15 — forked from kanru/Android.mk
Android GPS using libhardware
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
gps_test.cpp
LOCAL_SHARED_LIBRARIES := \
libcutils libhardware
LOCAL_MODULE:= test-gps
@amanjain08
amanjain08 / MyMapAdapter.java
Created May 23, 2018 06:13
Customize the User marker in HyperTrackMapFragment
public class MyMapAdapter extends HyperTrackMapAdapter {
@Override
public int getUserMarkerIconForActionID(Context mContext, InfoBoxModel.Type markerType,
UserActivity.ActivityType activityType, String actionID) {
int resource = R.drawable.ic_marker_drive;
switch (markerType) {
case ERROR:
resource = R.drawable.ic_no_data_received;
@amanjain08
amanjain08 / NearbyUser.java
Last active October 29, 2018 05:27
HyperTrack Android <> REST API network call. Steps: build.gradle > RetrofitServiceGenerator.java > RetrofitService.java > NearbyUser.java
//For nearby API you can pass actionId or latlng. For more info on nearbyAPI https://docs.hypertrack.com/api/entities/user.html#list-nearby-users
public void getNearbyUsers(String actionId, Latlng latlng){
//Create retrofit service object
RetrofitService getNearbyUserService = RetrofitServiceGenerator.createService(RetrofitService.class,context);
Call<UserListResponse> call = getNearbyUserService.getNearByUsers(actionID,latLng.latitude +","+latLng.longitude);
call.enqueue(new Callback<UserListResponse>() {
@Override
public void onResponse(Call<UserListResponse> call, Response<UserListResponse> response) {
if(response.isSuccessful()){
if(response.body() != null){
@amanjain08
amanjain08 / LoginActivity.java
Created October 27, 2017 07:03
Location Permission and Setting
/**
* Call this method to check Location Settings before proceeding for UserLogin
*/
private void checkForLocationSettings() {
// Check for Location permission
if (!HyperTrack.checkLocationPermission(this)) {
HyperTrack.requestPermissions(this);
return;
}
@amanjain08
amanjain08 / MainActivity.java
Last active December 19, 2017 05:38
Push Logs
HyperLog.setURL(“API URL”);
HyperLog.pushLogs(this, false, new HLCallback() {
@Override
public void onSuccess(@NonNull Object response) {
//Handle Log Push Success
}
@Override
public void onError(@NonNull VolleyError errorResponse) {
// Handle Log Push Error
}
@amanjain08
amanjain08 / Usage.java
Last active December 19, 2017 05:38
Usage
HyperLog.d(TAG,”Debug Log”);
@amanjain08
amanjain08 / MainActivity.java
Last active January 30, 2018 13:10
HyperLog Initialize
HyperLog.initialize(this);
HyperLog.setLogLevel(Log.VERBOSE);
@amanjain08
amanjain08 / build.gradle
Last active April 9, 2018 08:17
HyperLog Dependency
dependencies {
...
compile 'com.hypertrack:hyperlog:0.0.9'
...
}