Skip to content

Instantly share code, notes, and snippets.

View derohimat's full-sized avatar
🏠
Working from home

Deni Rohimat derohimat

🏠
Working from home
View GitHub Profile
@derohimat
derohimat / main.cpp
Last active May 22, 2017 15:20
dynamic struct
#include <iostream>
using namespace std;
struct NilaiMatKul {
char nim[11];
char nama[30];
char nilai[2];
};
#include <iostream>
#include <vector>
using namespace std;
void Binary_Search(const vector<int> &numbers, int value);
int main() {
vector<int> my_numbers;
@derohimat
derohimat / Root Checker
Last active April 27, 2017 15:39
Root Checker Android
public static boolean isEmulator() {
return Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| (Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic"))
|| "google_sdk".equals(Build.PRODUCT);
}
//
// main.c
// contoh menu C
//
// Created by Deni Rohimat on 11/11/16.
// Copyright © 2016 Deni Rohimat. All rights reserved.
//
#include <stdio.h>
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
# The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle.
-optimizations !code/simplification/arithmetic
-keep public class * extends android.app.Activity
package com.gaharitechnology.vokon.ui.view;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class GridHeaderSpacingItemDecoration extends RecyclerView.ItemDecoration {
private int spanCount;
private int spacing;
package com.gaharitechnology.vokon.ui.fragment.main;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.view.LayoutInflater;
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply from: '../config/quality.gradle'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
private void onPreferedLocationInMap() {
SharedPreferences sharedPreferences = PreferenceManager
.getDefaultSharedPreferences(mContext);
String location = sharedPreferences.getString(getString(R.string.pref_location_key),
getString(R.string.pref_location_default));
Uri geoLocation = Uri.parse("geo:0,0?").buildUpon()
.appendQueryParameter("q", location)
.build();
@derohimat
derohimat / MainFragment load Data
Last active April 9, 2016 04:49
Gist Sunshine MainFragment
private void loadData() {
mWeekForecastAdapter.clear();
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
String location = sharedPreferences.getString(getString(R.string.pref_location_key),
getString(R.string.pref_location_default));
String units = sharedPreferences.getString(getString(R.string.pref_units_key),
getString(R.string.pref_units_metric));
Retrofit retrofit = new Retrofit.Builder()