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
| #Author Anis_Boss | |
| #!/bin/bash | |
| zero='${#}' | |
| one='${##}' | |
| two='$((${##}<<${##}))' | |
| three='$(($((${##}<<${##}))#${##}${##}))' | |
| four='$((((${##}<<${##}))<<${##}))' | |
| five='$(($(($((${##}<<${##}))<<${##}))#${##}${##}))' | |
| six='$(($(($((${##}<<${##}))#${##}${##}))<<${##}))' | |
| seven='$(($(($(($((${##}<<${##}))#${##}${##}))<<${##}))#${##}${##}))' |
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
| import curses | |
| import sys | |
| # NOTE: It's up to YOU, dear coder, to call curses.setupterm() first. | |
| # I believe in you. (If this called setupterm(), then we'd call it more than needed.) | |
| def term_print(strs, *args, flush=True): | |
| ''' This expects `strs` to be a list of strings and tuples. Each | |
| string is printed, while each tuple is interpreted as a tput command | |
| with any needed parameters supplied. For example, the tuple ('smul',) |
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
| #!/bin/zsh | |
| : ' | |
| You need a personal access token for GitHub to avoid hitting the rate limit. Refer to the docs: | |
| https://docs.github.com/en/rest/guides/getting-started-with-the-rest-api | |
| https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token | |
| ' | |
| APPLE_OSS_DIR="all_apple_oss_archives" | |
| APPLE_OSS_REPO_FILE="all_apple_oss_repo_names.txt" |
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
| % Brainfuck interpreter written in PostScript. | |
| % | |
| % Written in about 2 to 3 hours around midnight. This includes the time spent | |
| % learning PostScript, which is now the first stack-based programming language | |
| % I've actually used. Because of this, the code is pretty ugly (even for | |
| % PostScript), but hey, it manages to correctly interpret the "Hello world" | |
| % example from the Wikipedia page on Brainfuck. | |
| % | |
| % For best results, run via `ghostscript brainfuck.ps`. Enter your brainfuck | |
| % code at the `brainfuck> ` prompt and your program input (if necessary) at the |
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
| #define CL_SILENCE_DEPRECATION | |
| // #if defined(__APPLE__) || defined(__MACOSX) | |
| // #include <OpenCL/cl.hpp> | |
| // #else | |
| // #include <CL/cl.hpp> | |
| // #endif | |
| #include "cl.hpp" |
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
| - (UIImage *)dynamicImage | |
| { | |
| UITraitCollection *const baseTraitCollection = /* an existing trait collection */; | |
| UITraitCollection *const lightTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleLight]]]; | |
| UITraitCollection *const purelyDarkTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; | |
| UITraitCollection *const darkTraitCollection = [UITraitCollection traitCollectionWithTraitsFromCollections:@[baseTraitCollection, purelyDarkTraitCollection]]; | |
| __block UIImage *lightImage; | |
| [lightTraitCollection performAsCurrentTraitCollection:^{ | |
| lightImage = /* draw image */; |
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
| #!/bin/bash | |
| set -e | |
| _xcrun() { | |
| DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer \ | |
| xcrun -sdk iphonesimulator \ | |
| "$@" | |
| } |
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
| // macOS x86_64 syscall works as follows: | |
| // Syscall id is moved into rax | |
| // 1st argument is moved into rdi | |
| // 2nd argument is moved into rsi | |
| // 3rd argument is moved into rdx | |
| // ... plus some more | |
| // Return value is stored in rax (where we put syscall value) | |
| // Mac syscall enum that contains the value to correctly call it | |
| enum Syscall: Int { |
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
| // | |
| // LMApiaryDeviceCrypto.h | |
| // | |
| // Created by Leptos on 11/18/18. | |
| // Copyright © 2018 Leptos. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #define kYouTubeBase64EncodedProjectKey @"vOU14u6GkupSL2pLKI/B7L3pBZJpI8W92RoKHJOu3PY=" |
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
| #include <stdio.h> | |
| #define SQ(x) (x)*(x) | |
| #define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0 | |
| #define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0 | |
| #define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0 | |
| #define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80 | |
| #define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60 | |
| #define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40 |
NewerOlder