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
class Anonymizer | |
include ActiveSupport::Benchmarkable | |
attr_reader :factory_names, :callbacks | |
def initialize(factory_names = nil, callbacks = {}) | |
raise ArgumentError.new("You must be in development to use the anonymizer") unless Rails.env.development? | |
require Rails.root.join("spec/factories") unless FactoryBot.factories.count > 0 | |
@factory_names = [*factory_names].compact.map(&:to_sym) |
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 | |
import AsyncAlgorithms | |
struct AsyncChanges<V>: ViewModifier where V : Equatable, V: Sendable { | |
typealias Element = (oldValue: V, newValue: V) | |
typealias Action = (AsyncStream<Element>) async -> Void | |
@State private var streamPair = AsyncStream<Element>.makeStream() | |
private let action: Action | |
private let value: V |
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
struct ContentViews: View { | |
@State var image: UIImage | |
@State private var imageWidth: CGFloat = 0 | |
@State private var imageHeight: CGFloat = 0 | |
@State private var imageFrame: CGRect = .zero | |
@State private var rotationAngle: Double = 0 | |
@State private var wdt: Double = 0 |
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
@available(iOS 15.0, *) | |
struct TwinkleView:View { | |
private func position(in proxy: GeometryProxy, sparkle:Sparkle) -> CGPoint { | |
let radius = min(proxy.size.width, proxy.size.height) / 2.0 | |
let drawnRadius = (radius - 5) * sparkle.position.x | |
let angle = Double.pi * 2.0 * sparkle.position.y | |
let x = proxy.size.width * 0.5 + drawnRadius * cos(angle) | |
let y = proxy.size.height * 0.5 + drawnRadius * sin(angle) |
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 Cocoa | |
public struct UIEdgeInsets { | |
public var top: CGFloat // specify amount to inset (positive) for each of the edges. values can be negative to 'outset' | |
public var left: CGFloat | |
public var bottom: CGFloat | |
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
<?php | |
/* | |
A simple PHP class to perform basic operations against Amazon S3 and compatible | |
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules. | |
Copyright 2022 Marco Arment. Released under the MIT license: | |
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 |
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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
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
namespace Neural | |
type Id = System.String | |
type Id<'T> = | |
| Id of Id | |
override this.ToString () = match this with Id id -> id | |
type IEntity = | |
abstract References : Id seq with get | |
abstract DeleteReference : Id -> IEntity option |
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
1. kn0thing | |
2. spez | |
3. third | |
4. fifth | |
5. fourth | |
6. agentorange | |
7. chickenlittle | |
8. erzengel | |
9. fizzypop | |
10. madmax2 |
NewerOlder