Skip to content

Instantly share code, notes, and snippets.

@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
@simonrenger
simonrenger / memoy_managment_cpp_resource_list.md
Last active April 23, 2024 21:30
C++ Memory Management Resource List
@AkkeyLab
AkkeyLab / HowXcodePreviewsWorks.md
Last active November 8, 2023 05:23
How XcodePreviews works

XcodePreviews の仕組み

XcodePreviews は SwiftUI で記述された UI を Xcode 上でプレビューするための新しい拡張機能です。 SwiftUI と UIKit には互換性があるため、 UIKit で構築された UI を XcodePreviews でプレビューさせることも可能です。
これによって、アプリケーションの再コンパイル・再実行なしに UI の変更を即時プレビューすることを可能にします。

今回は、この XcodePreviews がどのような仕組みで実現されているのかを解説します。

Build artefacts

XcodePreviews を実現するために新しく導入された Build artefacts を調べるために PreviewsSample という Single View App を作成しました。このプロジェクをビルドし、プレビュー可能な状態にしたときの Build artefacts が以下です。新しい中間ディレクトリとして Previews ディレクトリが作成されていることがわかります。

$ tree --filelimit 40 ~/Library/Developer/Xcode/DerivedData/PreviewsSample-bwzdqecwyvbvpofgqyzocvibrlbd
using System;
namespace UhoProtocol
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Uho("Hello, World!"));
Console.WriteLine(Ohu(Uho("Hello, World!")));
@neon-izm
neon-izm / HumanTrait.MuscleNames.csv
Created September 17, 2018 02:36
HumanPose.musclesの中身の95個のfloatはこんな感じ。55から94に指の情報が入っている
0 Spine Front-Back
1 Spine Left-Right
2 Spine Twist Left-Right
3 Chest Front-Back
4 Chest Left-Right
5 Chest Twist Left-Right
6 UpperChest Front-Back
7 UpperChest Left-Right
8 UpperChest Twist Left-Right
9 Neck Nod Down-Up
@HiImJulien
HiImJulien / Swift Meets CCxx.md
Last active March 30, 2024 19:00
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


Analytics

In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

@0xjac
0xjac / private_fork.md
Last active May 3, 2024 18:34
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@sanukin39
sanukin39 / XcodeSettingsPostProcesser.cs
Last active October 11, 2023 16:04
Unity XcodeAPI Settings Sample
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.iOS.Xcode;
using UnityEditor.Callbacks;
using System.Collections;
public class XcodeSettingsPostProcesser
{
@voluntas
voluntas / realtime_movie_stream.rst
Last active May 18, 2023 04:25
リアルタイム動画配信コトハジメ
@satoshin2071
satoshin2071 / gist:c99400015b95060d4e63
Last active April 2, 2021 21:59
CoreFoundation入門 メモリ管理

#CoreFoundation入門 メモリ管理

##概要

CoreFoundationのルートクラス的存在であるCFTypeの中から一番使用するであろう、メモリ管理関連のメソッドを確認。

##リファレンスカウント方式のメモリ管理

CoreFoundationはObjective-Cと同様の生成/保持/解放のリファレンスカウント方式。生成したらオーナーシップを持ち、必要なくなったらオーナーシップを破棄するのが必須なのも一緒。