Skip to content

Instantly share code, notes, and snippets.

View keremvatandas's full-sized avatar
🏠
Working from home

Kerem Vatandas keremvatandas

🏠
Working from home
View GitHub Profile
@keremvatandas
keremvatandas / cheatsheet-elasticsearch.md
Created April 9, 2021 08:42 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@keremvatandas
keremvatandas / .bashrc
Created March 18, 2021 11:46 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

Create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

or use PowerShell (run as Admin)

func printAddress<T>(of pointer: UnsafePointer<T>) {
print(pointer)
}
var ival: Int = 3
printAddress(of: &ival) // 0x00000001003edec0
var anyType: Any
anyType = ival
printAddress(of: &anyType) // 0x00000001003edec8
class User {
var name: String
var age: Int
var favProgLang: String
init(name: String, age: Int, favProgLang: String){
self.name = name
self.age = age
self.favProgLang = favProgLang
}
var ival: Int = 10
var dval: Double = 9.9
var sval: String = "Kerem"
struct Lispic {
// ...
}
class LearnSwift {
// ...
var ival: Int = 10
var dval: Double = 9.9
var sval: String = "Kerem"
struct ProgLang{
// KODLAR
}
class FavLang{
protocol P {
associatedtype T
func test(x: T) -> T
}
class Example : P {
func test(x: Example) -> Example
{
protocol P {
associatedtype T
func test(item: T) -> T
}
func getMax<T: Comparable>(dizi a: [T]) -> T
{
var max = a[0]
for i in 1..<a.count {
if max < a[i] {
max = a[i]
}
}