My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ival: Int = 10 | |
| var dval: Double = 9.9 | |
| var sval: String = "Kerem" | |
| struct Lispic { | |
| // ... | |
| } | |
| class LearnSwift { | |
| // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ival: Int = 10 | |
| var dval: Double = 9.9 | |
| var sval: String = "Kerem" | |
| struct ProgLang{ | |
| // KODLAR | |
| } | |
| class FavLang{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol P { | |
| associatedtype T | |
| func test(x: T) -> T | |
| } | |
| class Example : P { | |
| func test(x: Example) -> Example | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protocol P { | |
| associatedtype T | |
| func test(item: T) -> T | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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] | |
| } | |
| } | |
NewerOlder