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
| /* | |
| do { | |
| let libobjc = dlopen("/usr/lib/libobjc.A.dylib", RTLD_LAZY)! | |
| let _objc_getClass = FFIFunctionInvocation(symbol: "objc_getClass", handle: libobjc, returnType: .pointer, parameterTypes: [.pointer]) | |
| var text = "NSProcessInfo".utf8CString | |
| var arg: UnsafePointer<CChar>! |
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
| def f(x, y): | |
| return (x-y, x+y) | |
| def test(x, y): | |
| (x_, y_) = f(x, y) | |
| print(f"f({x}, {y}) = ({x_}, {y_})") | |
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 ref = require('ref'); | |
| module.exports = BufferType; | |
| /** | |
| * Fixed length "Buffer" type, for use in Struct type definitions. | |
| * | |
| * Optionally setting the `encoding` param will force to call | |
| * `toString(encoding)` on the buffer returning a String instead. | |
| */ |
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
| // https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzab6/poll.htm | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <sys/ioctl.h> | |
| #include <sys/poll.h> | |
| #include <sys/socket.h> | |
| #include <sys/time.h> | |
| #include <netinet/in.h> | |
| #include <errno.h> |
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
| // | |
| // server.c | |
| // exercise-08 | |
| // | |
| // Created by Lukas Kollmer on 2018-12-12. | |
| // Copyright © 2018 Lukas Kollmer. All rights reserved. | |
| // | |
| #include <stdio.h> | |
| #include <stdlib.h> |
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
| const replaceAll = (target, pattern, replacement) => { | |
| return target.replace(new RegExp(pattern, 'g'), replacement); | |
| }; | |
| const filterHdUrl = urls => { | |
| for (const url of urls) { | |
| if (url.label === 'HD') return url; | |
| } | |
| return urls[1]; | |
| }; |
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
| // Extracts the download urls from a table of links to files | |
| // 1. run the script below in your browser's console | |
| // 2. copy the printed urls, save to text file | |
| // 3. `wget -i YOUR_TEXT_FILE` | |
| const main = document.getElementById('block-system-main'); | |
| const table = main.children[main.children.length - 1].children[0].children[0]; | |
| const rows = Array.from(table.children[0].children) | |
| rows.splice(0, 1) | |
| console.log(rows.map(row => row.children[0].children[0].href).join('\n')); |
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
| let libobjc = dlopen("/usr/lib/libobjc.A.dylib", RTLD_LAZY)! | |
| let i_objc_getClass = FFIFunctionInvocation(symbol: "objc_getClass", handle: libobjc, returnType: .pointer, parameterTypes: [.pointer]) | |
| /*do { | |
| let NSProcessInfo_text = "NSProcessInfo".utf8CString | |
| var arg0: UnsafePointer<CChar>! | |
| NSProcessInfo_text.withUnsafeBufferPointer { | |
| arg0 = $0.baseAddress! |
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
| [yo:info] | |
| [0000] push __INVOKING_ALL_STATIC_INITIALIZERS__ | |
| [0001] call 0 | |
| [0002] pop 0 | |
| [0003] push main | |
| [0004] noop 0 | |
| [0005] _s11<%s-%nh>: | |
| [0006] noop 8 | |
| [0007] noop 60 | |
| [0008] noop 37 |
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
| [yo:info] | |
| [0000] push __INVOKING_ALL_STATIC_INITIALIZERS__ | |
| [0001] call 0 | |
| [0002] pop 0 | |
| [0003] push main | |
| [0004] noop 0 | |
| [0005] _s11<%s-%nh>: | |
| [0006] noop 8 | |
| [0007] noop 60 | |
| [0008] noop 37 |