Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
美しい未来に

Sky.G.Uieen GUIEEN

💭
美しい未来に
  • tokyo
View GitHub Profile
View GroupOrSemaphore.swift
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 Mar 16, 2021 — forked from matsuda/memoryAddress.swift
Get memory address in Swift
View memoryAddress.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 — forked from chrisveness/base64.js
Encode/decode ASCII string to/from base64
View base64.js
/**
* 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.
View FIXME.js
/**
* @param {string} s
* @param {string} p
* @return {boolean}
*/
let isMatch = function (s, p, shouldHide) {
function Logger() {
this.hide = false;
this.log = (...args) => {
View gist:abccacc29aa1c1acb07d036d5144062b
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 Feb 14, 2020
WIP - same underline width with text width
View SlidingTabView.swift
//
// 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
View go-settings.md
View NSString-with-format.md
let str = NSString(format:"%d , %f, %ld, %@", INT_VALUE, FLOAT_VALUE, LONG_VALUE, STRING_VALUE)
@GUIEEN
GUIEEN / README.md
Created Jan 2, 2020 — forked from kasperpeulen/README.md
How to pretty-print JSON using Dart.
View README.md
@GUIEEN
GUIEEN / diff.mdown
Created Dec 15, 2019 — forked from ndarville/diff.mdown
Paul Heckel's Diff Algorithm
View diff.mdown

[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.