Skip to content

Instantly share code, notes, and snippets.

View longpham2310's full-sized avatar
🐶
lazy

Phi Long longpham2310

🐶
lazy
  • Aldgate Ventures
  • Ho Chi Minh, Vietnam
View GitHub Profile
@longpham2310
longpham2310 / PanDirectionGestureRecognizer.swift
Created December 7, 2023 12:09 — forked from victorchee/PanDirectionGestureRecognizer.swift
Pan gesture recognizer with directions.
import UIKit
enum PanDirection {
case vertical
case horizontal
}
class PanDirectionGestureRecognizer: UIPanGestureRecognizer {
let direction: PanDirection
@longpham2310
longpham2310 / ConcurrentMap.swift
Created April 24, 2023 14:30 — forked from dabrahams/ConcurrentMap.swift
Concurrent Map Implementations, Benchmarked
// See commentary below this gist.
import Foundation
import QuartzCore
// Implementation from https://talk.objc.io/episodes/S01E90-concurrent-map
public final class ThreadSafe<A> {
var _value: A
let queue = DispatchQueue(label: "ThreadSafe")
init(_ value: A) { self._value = value }
@longpham2310
longpham2310 / 0_reuse_code.js
Created November 2, 2016 06:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@longpham2310
longpham2310 / WSDLParser
Created July 2, 2013 15:00
WSDL parser
// Test wsdl parser
@longpham2310
longpham2310 / gist:4256788
Created December 11, 2012 08:13 — forked from ekoneil/gist:3178821
Calling Facebook APIs with the 3.0 SDK
// #1: Graph API: /me
- (void)requestMe {
[FBRequestConnection startForMeWithCompletionHandler:^(FBRequestConnection *connection,
NSDictionary<FBGraphUser> *me,
NSError *error) {
if(error) {
[self printError:@"Error requesting /me" error:error];
return;
}
@longpham2310
longpham2310 / TableView navigation
Created November 22, 2012 02:50
A very simple example of TableView navigation
//create the window
var win1 = Ti.UI.createWindow(
{
backgroundColor:"#fff",
title: "Concurso"
}
);
//create navigation group
var navGroup = Titanium.UI.iPhone.createNavigationGroup(
@longpham2310
longpham2310 / UIDeviceHardware.h
Created November 8, 2012 02:44 — forked from Jaybles/UIDeviceHardware.h
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;