Skip to content

Instantly share code, notes, and snippets.

View muhasturk's full-sized avatar
🇹🇷
🧿👨🏼‍💻

Mustafa Hastürk muhasturk

🇹🇷
🧿👨🏼‍💻
View GitHub Profile
class PaymentViewModel : ObservableObject{
@Published var isLoadingRetrieveProducts = false
@Published var yearlySubscriptionPrice = ""
@Published var monthlySubscriptionPrice = ""
@Published var lifetimeSubscriptionPrice = ""
@Published var isLoadingPayment = false
@Published var showAlert = false
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active April 27, 2024 22:45
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ

Yandex.Disk REST API How To (quick af)

This will be modified, don't worry

1. Register

Simply make standard account on disk.yandex.com

2. Register App Client

First thing to do is to register new App Client. This can be done in oauth.yandex.com.

  • Click on "Create new client" button
extension KeyedDecodingContainer {
func decodeIfPresent<T: Decodable>(key: K) throws -> T? {
return try decodeIfPresent(T.self, forKey: key)
}
func decode<T: Decodable>(key: K) throws -> T {
return try decode(T.self, forKey: key)
}
}
@ghecho
ghecho / qr.swift
Last active May 29, 2019 12:32
Generate a QR image from a string using Swift 4
import CoreImage
static func createQR(fromString: String) -> CIImage?
{
let stringData = fromString.data(using: .utf8)
let filter = CIFilter(name: "CIQRCodeGenerator")
filter?.setValue(stringData, forKey: "inputMessage")
filter?.setValue("H", forKey: "inputCorrectionLevel")
let qrCodeImage = filter?.outputImage
let imageByTransform = qrCodeImage?.transformed(by: CGAffineTransform(scaleX: 15.0, y: 15.0))
@devpeds
devpeds / Singleton.swift
Created October 19, 2017 15:38
Thread-Safe Singleton Pattern in Swift
/* 1. Class Constant : Lazy initialization is supported. Officially recommanded way */
class Singleton {
static let shared = Singleton()
private init() { } // prevent creating another instances.
}
/* 2. Nested Struct : Workaround for the lack of static class constants in Swift 1.1 and earlier. still useful
in functions, where static constants and varialbles cannot be used. */
@minsOne
minsOne / SnowScene.swift
Last active January 30, 2020 21:16
Falling Snow
//
// SnowView.swift
// fallingsnow
//
// Created by JungMin Ahn on 2015. 11. 19..
// Copyright © 2015년 SmartStudy. All rights reserved.
//
import UIKit
import SpriteKit
anonymous
anonymous / sublime_text3_crack.md
Created June 7, 2015 04:58
Sublime Text 3092 3083 latest crack Win32 Win64 Linux64 Linux32 OSX Mac MacOS

cat

For pupil: all binary can be downloaded http://pan.baidu.com/s/1hqH2Pko

After overwriting, maybe need to run chmod +x /path/to/sublime_text. For linux default installation, need to add sudo.

For programmer:

VERSION PLATFORM OFFSET ORIGINAL CRACKED
@ruario
ruario / install-vivaldi.md
Last active September 8, 2021 13:48
This script automates extracting the contents of a Vivaldi package and installing it into the XDG data home directory (typically "$HOME/.local/share"). It also provides a convenient uninstall script.

Summary

Vivaldi Technologies currently only provide .deb and .rpm packages but it is possible to install it on different distros. This install script automates the process.

Install and Upgrade

You can use the script to fetch and install the latest public snapshot like so:

chmod +x install-vivaldi.sh # Only needed the first time
@vertexclique
vertexclique / cracking.md
Last active April 8, 2024 18:24
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text