Skip to content

Instantly share code, notes, and snippets.

View anjnkmr's full-sized avatar

Anjan Kumar anjnkmr

View GitHub Profile
@anjnkmr
anjnkmr / Application.java
Last active May 9, 2019 00:19
Date Time Ago Function
package com.rak.tests;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Application {
public static void main(String[] args){
System.out.println(getTimeAgo("2017-04-23 12:41:00", "yyyy-MM-dd HH:mm:ss", (long) (5.5*60*60*1000)));
@anjnkmr
anjnkmr / AndroContextMenu.swift
Created May 20, 2017 04:49
Android Like Context Menu
import UIKit
class AndroContextMenuAppearance{
static var MAX_HEIGHT: CGFloat = 300;
static var WIDTH: CGFloat = 200;
}
class AndroContextMenu{
let screenSize = UIScreen.main.bounds;
var options = [AndroContextMenuItem]();
@anjnkmr
anjnkmr / UIWindowExt.swift
Last active May 18, 2017 07:05
Simple iOS Toast
var ak_toast_view_tag = 595;
var ak_toast_label_tag = 585;
extension UIWindow{
func showToast(text: String){
let v = getToastView();
if v.superview != nil{
v.removeFromSuperview();
}
let label = getToastLabel();
@anjnkmr
anjnkmr / SocialService.swift
Created March 27, 2017 06:20
Social Service for Swift3
import Foundation
import UIKit
import Social
class SocialService{
static let shared = SocialService();
private init(){
}
@anjnkmr
anjnkmr / SocialService.swift
Last active March 27, 2017 06:20 — forked from anonymous/SocialService.swift
Social Sharing iOS Swift 2.3
//
// SocialService.swift
// SocialSharing
//
// Created by Zonup Mac 3 on 10/11/16.
// Copyright © 2016 Zonup. All rights reserved.
//
import UIKit;
import Social;