Skip to content

Instantly share code, notes, and snippets.

View bungkhus's full-sized avatar

Muhammad Khusnan bungkhus

View GitHub Profile
func downloadFile(withStringURL url: String) {
if let downloadUrl = URL(string: url) {
let documentsPath1 = NSURL(fileURLWithPath: NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0])
let logsPath = documentsPath1.appendingPathComponent(CHWords.DIRECTORY_NAME)
let fileManager = FileManager.default
guard let commHubDir = logsPath else { return print("path doesn't exists") }
if fileManager.fileExists(atPath: commHubDir.relativePath) {
import android.app.ProgressDialog;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomSheetBehavior;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
@bungkhus
bungkhus / designer.html
Last active April 17, 2017 06:44
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">
<template>
<style>
#core_drawer_panel {
position: absolute;
top: 0px;
right: 0px;
@bungkhus
bungkhus / DeviceManager.swift
Created March 6, 2017 07:23
get UDID from device using SAMKeychain library to persist the UDID per Device
//
// DeviceManager.swift
// MisterAladin
//
// Created by Bungkhus on 1/11/17.
// Copyright © 2017 Suitmedia. All rights reserved.
//
import Foundation
import SAMKeychain
@bungkhus
bungkhus / NewBenefitsViewController.swift
Last active February 20, 2017 09:12
NewBenefitsViewController
//
// NewBenefitsViewController.swift
// MisterAladin
//
// Created by Bungkhus on 10/25/16.
// Copyright © 2016 Suitmedia. All rights reserved.
//
import UIKit
import RxSwift