Skip to content

Instantly share code, notes, and snippets.

View GUIEEN's full-sized avatar
💭
美しい未来に

Seung Kwak GUIEEN

💭
美しい未来に
  • tokyo
View GitHub Profile
func performUsingGroup() {
let dq1 = DispatchQueue.global(qos: .default)
let dq2 = DispatchQueue.global(qos: .default)
let group = DispatchGroup()
for i in 1...3 {
dq1.async(group: group) {
print("\(#function) DispatchQueue 1: \(i)")
}
}
@GUIEEN
GUIEEN / memoryAddress.swift
Created March 16, 2021 06:07 — forked from matsuda/memoryAddress.swift
Get memory address in Swift
///
/// https://stackoverflow.com/a/29741007
///
let s = Struct() // Struct
withUnsafePointer(to: s) {
print(String(format: "%p", $0)
}
///
/// http://stackoverflow.com/a/36539213/226791
@GUIEEN
GUIEEN / base64.js
Created May 7, 2020 17:02 — forked from chrisveness/base64.js
Encode/decode ASCII string to/from base64
/**
* Encode string into Base64, as defined by RFC 4648 [http://tools.ietf.org/html/rfc4648].
* As per RFC 4648, no newlines are added.
*
* Characters in str must be within ISO-8859-1 with Unicode code point <= 256.
*
* Can be achieved JavaScript with btoa(), but this approach may be useful in other languages.
*
* @param {string} str ASCII/ISO-8859-1 string to be encoded as base-64.
* @returns {string} Base64-encoded string.
@GUIEEN
GUIEEN / FIXME.js
Created April 9, 2020 03:56
leetcode
/**
* @param {string} s
* @param {string} p
* @return {boolean}
*/
let isMatch = function (s, p, shouldHide) {
function Logger() {
this.hide = false;
this.log = (...args) => {
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
@GUIEEN
GUIEEN / SlidingTabView.swift
Created February 14, 2020 09:26
WIP - same underline width with text width
//
// SlidingTabView.swift
//
// Copyright (c) 2019 Quynh Nguyen
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@GUIEEN
GUIEEN / go-settings.md
Created February 3, 2020 16:38
Go settings
@GUIEEN
GUIEEN / NSString-with-format.md
Created January 22, 2020 05:18
ns string format
let str = NSString(format:"%d , %f, %ld, %@", INT_VALUE, FLOAT_VALUE, LONG_VALUE, STRING_VALUE)
@GUIEEN
GUIEEN / README.md
Created January 2, 2020 11:51 — forked from kasperpeulen/README.md
How to pretty-print JSON using Dart.
@GUIEEN
GUIEEN / diff.mdown
Created December 15, 2019 06:54 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm

[Isolating Differences Between Files][paper]

Advantage over Other Algorithms

The diff output is more specific:

[I]f a whole block of text is moved, then all of it, rather than just the beginning and end, is detected as changed.

>The algorithm described here avoids these difficulties. It detects differences that correspond very closely to our intuitive notion of difference.