Skip to content

Instantly share code, notes, and snippets.

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

Mustafa Hastürk muhasturk

🇹🇷
🧿👨🏼‍💻
View GitHub Profile
@yuxel
yuxel / varnish.vcl
Last active December 29, 2015 04:49
Özgür Web Teknolojileri Günleri 2013'deki Varnish Konfigursayonu
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend server1 {
.host = "haber.local";
.port = "8080";
}
@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))
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)
}
}
@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

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
@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. */
@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
@mmstick
mmstick / Ubuntu Kernel Upgrader Script
Last active March 11, 2023 04:53
Asks the user whether they want to install the latest RC or stable, then downloads the correct kernel and installs it.
#!/bin/bash
cd /tmp
if ! which lynx > /dev/null; then sudo apt-get install lynx -y; fi
if [ "$(getconf LONG_BIT)" == "64" ]; then arch=amd64; else arch=i386; fi
function download() {
wget $(lynx -dump -listonly -dont-wrap-pre $kernelURL | grep "$1" | grep "$2" | grep "$arch" | cut -d ' ' -f 4)
}
class PaymentViewModel : ObservableObject{
@Published var isLoadingRetrieveProducts = false
@Published var yearlySubscriptionPrice = ""
@Published var monthlySubscriptionPrice = ""
@Published var lifetimeSubscriptionPrice = ""
@Published var isLoadingPayment = false
@Published var showAlert = false
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