This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml, { safeLoad } from 'js-yaml' | |
import fs from 'fs' | |
console.log('') | |
console.log('--- file parsing ---') | |
const channelPath = './data/old/' | |
const channelsFiles = fs.readdirSync(channelPath).filter(name => name[0] != '.') | |
const filesProgress = [] | |
const channelFields = new Map() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EHLO domain.com. | |
AUTH LOGIN | |
ZGFtaWFhbkBpY2xvdWQuY29t | |
<App Specific Password here> | |
mail from:<[email protected]> | |
rcpt to:<[email protected]> | |
DATA | |
From: Sender <[email protected]> | |
Subject: Simple Mail Transfer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let minimumFileSize = 24_000_000 | |
let separator = [UInt8](repeating: 0, count: 50) | |
let arwPrefix: [UInt8] = [0x49, 0x49, 0x2A, 0, 0x08, 0, 0, 0, 0x15, 0, 0xFE, 0, 0x04, 0, 0x01, 0, 0, 0, 0x01, 0, 0, 0, 0x03, 0x01, 0x03, 0, 0x01, 0, 0, 0, 0x06, 0] | |
let disc = try Data(contentsOf: URL(fileURLWithPath: "path-to-drive-image")) | |
var cursor = disc.startIndex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct CoreGraphics.CGSize | |
import struct CoreGraphics.CGPoint | |
import struct CoreGraphics.CGFloat | |
extension CGSize: SIMD { | |
public typealias MaskStorage = SIMD2<CGFloat.NativeType.SIMDMaskScalar> | |
public subscript(index: Int) -> CGFloat { | |
get { | |
index == 0 ? width : height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SwiftUI | |
struct ContentView: View { | |
@State private var model = Model() | |
var body: some View { | |
ZStack { | |
CustomCollectionView(lastSelectedIndex: $model.index) | |
IndexPreviewer(model: model) |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
extension View { | |
func float<Content: View>(above: Content) -> ModifiedContent<Self, Above<Content>> { | |
self.modifier(Above(aboveContent: above)) | |
} | |
} | |
struct Above<AboveContent: View>: ViewModifier { | |
let aboveContent: AboveContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function splitCellVertically(state, dispatch) { | |
if (!isInTable(state)) { return false } | |
const rect = selectedRect(state); | |
const selectionWidth = rect.right - rect.left | |
const selectionHeight = rect.bottom - rect.top | |
if (selectionWidth > 1 || selectionHeight > 1) {return false} | |
if (dispatch) { | |
const tr = state.tr | |
const ref = rect | |
const row = rect.bottom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct FixedHexagon: View { | |
var body: some view { Hexagon().aspectRatio(2/sqrt(3), contentMode: .fit) } | |
} | |
struct Hexagon: Shape { | |
func path(in rect: CGRect) -> Path { | |
Path { path in | |
let width = rect.size.width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// ImageExtractor | |
// | |
// Created by Damiaan on 13/08/2019. | |
// Copyright © 2019 dPro. All rights reserved. | |
// | |
import Quartz |