Skip to content

Instantly share code, notes, and snippets.

@pebble8888
pebble8888 / gist:95220cd72e4c52988310d6966e532d6f
Last active November 26, 2023 01:22
std::filesystem::path
#include <iostream>
#include <filesystem>
#include <stdio.h>
#include <wchar.h>
int main(int argc, const char * argv[]) {
std::filesystem::path path1 = "あ";
const auto str_a = path1.string();
const unsigned char* a = (const unsigned char*)str_a.c_str();
@pebble8888
pebble8888 / make_move_iterator.cpp
Created January 2, 2023 06:14
make move iterator
#include <iostream>
#include <vector>
struct Point {
int x;
Point(int x)
: x(x)
{
}
@pebble8888
pebble8888 / first_ten_prime.hpp
Created January 1, 2023 08:04
forward iterator sample
#pragma once
#include <memory>
#include <iterator>
template<typename T>
class Primes {
public:
class prime_iterator {
public:
@pebble8888
pebble8888 / AudioUnitErrorCode
Created June 13, 2022 01:32
audio unit error code
Frameworks/AudioToolbox/AUComponent.h
CF_ENUM(OSStatus) {
kAudioUnitErr_InvalidProperty = -10879,
kAudioUnitErr_InvalidParameter = -10878,
kAudioUnitErr_InvalidElement = -10877,
kAudioUnitErr_NoConnection = -10876,
kAudioUnitErr_FailedInitialization = -10875,
kAudioUnitErr_TooManyFramesToProcess = -10874,
kAudioUnitErr_InvalidFile = -10871,
@pebble8888
pebble8888 / macOSPIC
Created April 26, 2020 12:01
macOS PIC
You must use special flags with cc when compiling a shared ilbrary or a bundle on Darwin.
One difference between Darwin and
many other Unix systems is that no position-independent code (PIC) flag is needed,
since it is the default for Darwin.
@pebble8888
pebble8888 / WKWebView
Created November 18, 2019 04:13
UIWebView -> WKWebView
didFailLoadWithError => didFailNavigation
webViewDidFinishLoad => didFinishNavigation
webViewDidStartLoad => didStartProvisionalNavigation
shouldStartLoadWithRequest => decidePolicyForNavigationAction
@pebble8888
pebble8888 / gist:2ba4c7959b581698dd483cbaf909b973
Created September 29, 2018 06:25
get go standard lib list
go list std
swiftc -emit-assembly source.swift > output.s
_T0s14CountableRangeVAByxGx5lower_x5uppert15uncheckedBounds_tcfCSi_Tg5
---> generic specialization <Swift.Int> of Swift.CountableRange.init(uncheckedBounds: (lower: A, upper: A)) -> Swift.CountableRange<A>
~$ xcrun swift-demangle __T05hello1as14CountableRangeVySiGvp
_T05hello1as14CountableRangeVySiGvp ---> hello.a : Swift.CountableRange<Swift.Int>
~$ xcrun swift-demangle __T05hello1dSivp
xcrun swift-demangle __T015DVTSourceEditor016DVTPegasusSourceB4ViewCN
_T015DVTSourceEditor016DVTPegasusSourceB4ViewCN ---> type metadata for DVTSourceEditor.DVTPegasusSourceEditorView
pod trunk push --swift-version=4.0 ed25519swift.podspec --allow-warnings
pod spec lint --swift-version=4.0 ed25519swift.podspec --allow-warnings