Skip to content

Instantly share code, notes, and snippets.

View ytyubox's full-sized avatar
😎
TooFastToSlow

Tsungyu Yu ytyubox

😎
TooFastToSlow
View GitHub Profile
@izakpavel
izakpavel / LightningView.swift
Created December 3, 2020 07:34
Lightnings in SwiftUI
//
// Lightnings fun
//
// BEWARE highly unoptimized!
//
// Created by Pavel Zak on 30/11/2020.
//
import SwiftUI
@xsleonard
xsleonard / UUID+Extensions.swift
Created August 26, 2020 06:51
Swift: Convert UUID to and from Data and Int64
extension UUID {
// UUID is 128-bit, we need two 64-bit values to represent it
var integers: (Int64, Int64) {
var a: UInt64 = 0
a |= UInt64(self.uuid.0)
a |= UInt64(self.uuid.1) << 8
a |= UInt64(self.uuid.2) << (8 * 2)
a |= UInt64(self.uuid.3) << (8 * 3)
a |= UInt64(self.uuid.4) << (8 * 4)
a |= UInt64(self.uuid.5) << (8 * 5)
@Iridium-IO
Iridium-IO / README.md
Last active January 30, 2024 10:36
Collapsible Markdown Code Blocks

Example Collapsible Content

Style 1

Click to see more:
Given the following python code
from pychartjs import BaseChart

class myChart(BaseChart):
@darrarski
darrarski / FetchedResultsPublisher.swift
Last active June 6, 2024 18:40
Swift-Combine-CoreData-Fetched-Results-Publisher
import Combine
import CoreData
public final class FetchedResultsPublisher
<ResultType>
: Publisher
where
ResultType: NSFetchRequestResult
{

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@un33k
un33k / sed cheatsheet
Created August 22, 2011 13:28
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'