Skip to content

Instantly share code, notes, and snippets.

View tanmayb123's full-sized avatar

Tanmay Bakshi tanmayb123

  • Software Developer, YouTuber
  • Canada
View GitHub Profile
; ModuleID = '/tmp/webcompile/_8542_0.bc'
source_filename = "/tmp/webcompile/_8542_0.cc"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-ellcc-linux"
; Function Attrs: noinline nounwind optnone
define i32 @_Z5toIntf(float) #0 {
%2 = alloca float, align 4
store float %0, float* %2, align 4
%3 = load float, float* %2, align 4
import Foundation
extension String {
func paddedZeros(length: Int) -> String {
if count == length {
return self
}
return ([Character](repeating: "0", count: length - count) + Array(self)).map({ String($0) }).joined()
}
}
struct ContentView : View {
@State var stackLocation: CGPoint = .zero
@State var stackAngle: Angle = .zero
var body: some View {
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
.offset(x: stackLocation.x, y: stackLocation.y)
.gesture(DragGesture()
.onChanged {
self.stackLocation = $0.location
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
.offset(x: stackLocation.x, y: stackLocation.y)
.gesture(DragGesture()
.onChanged {
self.stackLocation = $0.location
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
.offset(x: stackLocation.x, y: stackLocation.y)
struct ContentView : View {
@State var stackLocation: CGPoint = .zero
var body: some View {
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
VStack(alignment: .leading) {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
VStack {
Text("Hello World")
.font(.largeTitle)
.bold()
Text("This is my test app.")
}
Text("Hello World")
.font(.largeTitle)
.bold()