Skip to content

Instantly share code, notes, and snippets.

View pofat's full-sized avatar

Pofat pofat

View GitHub Profile
@pofat
pofat / Fastfile
Last active March 26, 2023 01:58
Shell script and Fastfile to build universal framework.
fastlane_version "2.50.1"
default_platform :ios
platform :ios do
before_all do
# ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
# cocoapods
end
@pofat
pofat / Wall Papers
Last active August 22, 2017 08:21
For wall papers URL pools (720x1280)
https://wallpaperscraft.com/image/cosmos_sun_eclipse_clouds_58244_720x1280.jpg,https://wallpaperscraft.com/image/mountains_nature_sky_river_beautiful_scenery_93460_720x1280.jpg
@pofat
pofat / Sticker.json
Created August 6, 2017 15:43
Include all information to parse a sticker URL
{
"thumbnail_must_containt" : "mdCMN09Image"
}
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@pofat
pofat / wordLadder.swift
Last active April 27, 2017 12:30
LeetCode: 127. Word Ladder
class Solution {
func ladderLength(_ beginWord: String, _ endWord: String, _ wordList: [String]) -> Int {
var wordSet: Set<String> = Set(wordList)
guard wordSet.contains(endWord) else {
return 0
}
// Lookup table for neighbors
@pofat
pofat / html5_template.html
Created February 11, 2017 03:13
HTML5 basic template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
@pofat
pofat / .vimrc
Last active August 19, 2018 18:54
vimrc for Raspberry Pi 3
set nocompatible
set tabstop=4
set shiftwidth=4
set expandtab
set hlsearch
set incsearch
set guioptions-=e
@pofat
pofat / Get_IP_Ethernet.ino
Last active January 5, 2017 21:20
MQTT related example code of Arduino
#include <SPI.h>
#include <Ethernet.h>
// Any MAC that won't conflice with any device in your network will do
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDe, 0x02 };
EthernetClient client;
void setup() {
@pofat
pofat / InsertionSort.swift
Last active December 3, 2016 15:22
Implement algorithms with Swift 3
// This implementation is originally from `https://boxueio.com`
typealias Criterial<T> = (T, T) -> Bool
func insertionSortOf<T: Comparable>(_ coll: [T], byCriteria: Criterial<T> = { $0 < $1 }) -> [T] {
guard coll.count > 1 else {
return coll
}
@pofat
pofat / CustomUnwrapper.swift
Last active December 1, 2016 13:10
A force unwrapper for Optional type with error hint, suitable for development
// This trick is orininally from 'https://boxueio.com/'
infix operator !!
func !!<T>(optional: T?, errorMessage: @autoclosure () -> String) -> T {
if let value = optional { return value }
fatalError(errorMessage)
}