Skip to content

Instantly share code, notes, and snippets.

View fishkingsin's full-sized avatar
✈️

James Kong fishkingsin

✈️
View GitHub Profile
@fishkingsin
fishkingsin / HashTable.swift
Created March 17, 2021 14:00
HashTable implementation in swift
import UIKit
import XCTest
class HashTableNode<T> {
var value: T
var key: String
var nextNode: HashTableNode?
init(value: T, key: String) {
self.value = value
self.key = key
@fishkingsin
fishkingsin / unitTestAPIService404.swift
Last active March 2, 2021 15:29
unitTestAPIService404
import XCTest
import Foundation
class APIService {
let defaultSession = URLSession(configuration: .default)
typealias APIServiceCompletionHandler = (Int?) -> Void
var urlString: String?
init(urlString: String) {
self.urlString = urlString
}
package com.creedon.Nixplay;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.AsyncTask;
import android.support.media.ExifInterface;
import android.util.Log;
@fishkingsin
fishkingsin / parser.fish
Created February 21, 2019 12:21
parse pod from folder
function paresPod
for i in (find . -name "*.podspec")
echo "pod" "'"(basename "$i" ".podpsec")"'" ", :path =>" "'"(dirname "$i")"'",
end
end
import UIKit
/*
class Person {
let name: String
init(name: String) {
self.name = name
}
@fishkingsin
fishkingsin / generator2.sh
Last active February 13, 2019 04:27
I want to gen a template images for testing, here this is
doit() {
echo $PWD
if test -e $1.jpg ; then
echo "already created $1"
else
echo Doing it for $1
convert -size 400x400 plasma:fractal -blur 0x10 \
tile_diag_source$1.jpg
@fishkingsin
fishkingsin / README.md
Created August 20, 2018 04:15 — forked from Ehesp/README.md
React Native ViewPager (Android + iOS with extras)

ViewPager

A ViewPager for Android & iOS. It also has handy features implemented to handle common use-case scenarios.

Basic Usage

const views = [
  <View><Text>View 1</Text></View>,
 View 2,
@fishkingsin
fishkingsin / RNMultipleTargetsInstructions.md
Last active June 6, 2018 07:01 — forked from jacks205/RNMultipleTargetsInstructions.md
Settings up multiple app targets in React-Native
@fishkingsin
fishkingsin / generator.sh
Last active October 19, 2018 04:21
gen dummy image iwth difference pattern
for i in $(seq $1 $2)
do
if test -e $i.jpg ; then
echo "already created $i"
else
convert -size 50x50 xc: +noise Random -virtual-pixel Tile -blur 0x5 \
-auto-level -separate -background white \
-compose ModulusAdd -flatten -channel G -combine +channel \
-set colorspace HSB -colorspace RGB tile_diag_source.jpg
@fishkingsin
fishkingsin / generate_images.fish
Created September 19, 2017 07:54
generate images
for i in (seq 10000)
if test -e $i.jpg
echo "already created $i"
else
echo create $i
convert -background lightgray -fill black -size 2458x1536 -pointsize 720 -gravity center label:$i $i.jpg
end
end