This file contains 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
fileprivate func directoryExistsAtPath(_ path: String) -> Bool { | |
var isDirectory = ObjCBool(true) | |
let exists = FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) | |
return exists && isDirectory.boolValue | |
} |
This file contains 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
import Foundation | |
func disable_gdb() { | |
let PT_DENY_ATTACH: CInt = 31 | |
let handle = dlopen("/usr/lib/libc.dylib", RTLD_NOW) | |
let sym = dlsym(handle, "ptrace") | |
typealias PtraceAlias = @convention(c) (CInt, pid_t, CInt, CInt) -> CInt | |
let ptrace = unsafeBitCast(sym, to: PtraceAlias.self) | |
_ = ptrace(PT_DENY_ATTACH, 0, 0, 0) | |
dlclose(handle) |
This file contains 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
export class Dispatcher { | |
constructor () { | |
this.events = {}; | |
} | |
addListener (event, callback) { | |
// Check if the callback is not a function | |
if (typeof callback !== 'function') { | |
console.error(`The listener callback must be a function, the given type is ${typeof callback}`); | |
return false; |
This file contains 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
import play.api.libs.ws.WS | |
import play.api.mvc.MultipartFormData.FilePart | |
import play.api.mvc.MultipartFormData | |
import utilities.MultipartFormDataWriteable._ | |
... | |
val url = "https://example.com" | |
val dataParts = Map( |
This file contains 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
DB_URL=jdbc:h2:mem:datasource;MODE=Oracle;INIT=runscript from 'classpath:/sql/h2.creation.sql' | |
h2.creation.sql | |
------------------------- | |
runscript from 'classpath:/testing/beforeclass/001-init.sql'; -- from class path | |
runscript from '~/001-init.sql'; --from ${user.home} |