Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ben arkilis

🎯
Focusing
Block or report user

Report or block arkilis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arkilis
arkilis / ViewController.m
Created Dec 21, 2018
Are you familar with viewWillAppear, viewDidAppear, viewDidLoad, viewWillDisappear and viewDidDisappear in Objective-C
View ViewController.m
//
// ViewController.m
// TestBlock
//
// Created by Ben Liu on 14/4/17.
// Copyright © 2017 Ben Liu. All rights reserved.
//
#import "ViewController.h"
@arkilis
arkilis / viewcontroller.swift
Last active Dec 21, 2018
Are you familar with viewWillAppear, viewDidAppear, viewDidLoad, viewWillDisappear and viewDidDisappear (swift)
View viewcontroller.swift
//
// Swift 4
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
@arkilis
arkilis / CameraFollow.cs
Last active Apr 13, 2018
camera follow
View CameraFollow.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFollow : MonoBehaviour {
// assign the player (pink cube)
public Transform player;
// offset is used to put the main camra a bit behind the player (pink cube)
@arkilis
arkilis / build.gradle
Last active Mar 28, 2018
build.gradle exmpale
View build.gradle
Dbuildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
View androdi_manifest_googlemap.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appape.yang.kotlinmap">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@arkilis
arkilis / get_google_map.kt
Created Nov 30, 2017
Get location from google map on kotlin
View get_google_map.kt
// 1.
class LocationActivity : AppCompatActivity(), OnMapReadyCallback {
// 2.
private var mLocationRequest: LocationRequest? = null
private val UPDATE_INTERVAL = (10 * 1000).toLong() /* 10 secs */
private val FASTEST_INTERVAL: Long = 2000 /* 2 sec */
private var latitude = 0.0
private var longitude = 0.0
View build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
defaultConfig {
applicationId "your.application.id."
View static_var_method.kt
nterface Factory<T> {
fun create(): T
}
class Key(val value: Int) {
companion object: Factory<Key> {
// static variable 1:
@JvmField
val staticVar = "this is info"
@arkilis
arkilis / kotlin_static.kt
Created Nov 14, 2017
kotlin variable & methods
View kotlin_static.kt
class KotlinClass {
companion object {
val staticVariable = 1
fun staticMethod():String { return "some string" }
}
}
KotlinClass.staticVariable // static variable
KotlinClass.staticMethod() // static methods
You can’t perform that action at this time.