Skip to content

Instantly share code, notes, and snippets.

View yusufozgul's full-sized avatar
👻
Working from anywhere

Yusuf Özgül yusufozgul

👻
Working from anywhere
View GitHub Profile
SELECT * FROM SomeError
TIMESERIES SINCE 1800 seconds ago COMPARE WITH 604800 seconds ago EXTRAPOLATE
SELECT average(responseTime) FROM MobileRequest
WHERE `requestDomain` like'%.awesome.domain' AND requestPath like '%/foo/bar'
TIMESERIES SINCE 1800 seconds ago COMPARE WITH 604800 seconds ago EXTRAPOLATE
@yusufozgul
yusufozgul / FundInfoWidget.js
Created April 8, 2021 19:46
Scriptable widget for fund info
let widget = new ListWidget()
let mainColor = Color.dynamic(Color.black(), Color.white())
var allTotal = 0
var teknoloji = {
'daily': "",
'monthly': "",
'current': "",
'change' : "",
@yusufozgul
yusufozgul / iOSFonWidget.js
Created April 8, 2021 19:44
Scriptable widget for fund info
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: chart-line;
let widget = new ListWidget()
let mainColor = Color.dynamic(Color.black(), Color.white())
var allTotal = 0
var teknoloji = {
'daily': "",
// for: https://medium.com/@ozgurs/hızlı-şekilde-resim-dataseti-oluşturma-cfccf4a40c79
urls=Array.from(document.querySelectorAll(".rg_i")).map(el=> el.hasAttribute("data-src")?el.getAttribute("data-src"):el.getAttribute("data-iurl"));
window.open("data:text/csv;charset=utf-8," + escape(urls.join("\n")));
import UIKit
var jsonString: String = """
{
"link": "https://yusufozgul.com",
"data": [
{ "type": "comments", "content": "Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir." },
{ "type": "comments", "content": "Lorem Ipsum, adı bilinmeyen bir matbaacının bir hurufat numune kitabı oluşturmak üzere bir yazı galerisini alarak karıştırdığı 1500'lerden beri endüstri standardı sahte metinler olarak kullanılmıştır." }
]
}
@yusufozgul
yusufozgul / willPerformPreviewActionForMenuWith.swift
Last active March 18, 2020 13:09
willPerformPreviewActionForMenuWith.swift
func tableView(_ tableView: UITableView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
guard let destinationViewController = animator.previewViewController else { return }
animator.addAnimations { self.present(destinationViewController, animated: true) }
}
import UIKit
class DetailViewController: UIViewController
{
var selectedText: String?
override func viewDidLoad() {
super.viewDidLoad()
let label = UILabel()
label.text = "Selected Row: \(selectedText ?? "NO TEXT")"
func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
let config = UIContextMenuConfiguration(identifier: "\(indexPath.row)" as NSCopying, previewProvider: {
return DetailViewController(selectedText: self.array[indexPath.row])
}) { action in
let viewMenu = UIAction(title: "Go Detail VC", image: UIImage(systemName: "eye.fill"), identifier: UIAction.Identifier(rawValue: "view")) {_ in
self.present(DetailViewController(selectedText: "\(indexPath.row)"), animated: true)
}
let deleteMenu = UIAction(title: "Delete", image: UIImage(systemName: "trash.fill"), identifier: nil) { (action) in
@yusufozgul
yusufozgul / Alert,ActionSheet-SwiftUI.swift
Last active August 5, 2019 13:12
SwiftUI Alert & Action Sheet
struct ContentView: View
{
@State var isShowAlert = false
@State var isShowActionSheet = false
var body: some View
{
VStack
{