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
| %YAML 1.2 | |
| --- | |
| name: ROS message definition | |
| file_extensions: [msg] | |
| scope: source.rosmsg | |
| contexts: | |
| main: | |
| - match: \#.*$ | |
| scope: comment.line.rosmsg |
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
| function factorial(number) { | |
| let result = 0; | |
| for(let i = number; i > 0; --i) { | |
| result += Math.log10(i); | |
| } | |
| return result; | |
| } | |
| function scientific_factorial(number) { | |
| let fact = factorial(number); |
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 Singleton { | |
| public: | |
| static Singleton& get() { | |
| static Singleton instance; | |
| return instance; | |
| } | |
| Singleton(Singleton&&) = delete; | |
| Singleton& operator=(Singleton&&) = delete; |
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
| /** | |
| * Those functions are related to: https://www.youtube.com/watch?v=nXaxk27zwlk&t=2446s | |
| * | |
| * They are used to allow to benchmark functions with -O3 that would otherwise be removed because it is unused. | |
| * | |
| * escape(&object) prevents object to be optimized out | |
| * "This ASM code has some unknowable side effects and possibly stored the pointer globally" | |
| * clobber() tells the compiler some asm might be reading the whole memory | |
| * "This ASM code could probably read/write to all memory" => observe all memory | |
| */ |
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 tweepy, json, time, sys | |
| auth = tweepy.OAuth1UserHandler( | |
| <api keys here> | |
| ) | |
| api = tweepy.API(auth) | |
| d = json.loads(open(sys.argv[1]).read().split("=", 1)[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
| import "std/fs" for Fs | |
| import "std/os" for Runtime | |
| var input = Fs.read("./1/input.txt") | |
| var output = [] | |
| for (line in input.split("\n")) { | |
| var fromStart = Fiber.new { |
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
| $ docker history imagename | |
| IMAGE CREATED CREATED BY SIZE | |
| f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
| 28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
| 8dbd9e392a96 7 months ago 131.5 MB | |
| $ docker tag 2844 imagename # <-- that's the secret right there | |
| $ docker history imagename | |
| IMAGE CREATED CREATED BY SIZE |
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 time | |
| """ This is a proper debounce function, the way a electrical engineer would think about it. | |
| This wrapper never calls sleep. It has two counters: one for successful calls, and one for rejected calls. | |
| If the wrapped function throws an exception, the counters and debounce timer are still correct """ | |
| class Debounce(object): | |
| def __init__(self, period): |
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
| # Step 1 — Update Base Systems | |
| sudo apt update && sudo apt -y upgrade | |
| # Step 2 — Import Repository Signing Key | |
| wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
| # Step 3 — Add PostgreSQL repository | |
| sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
| # Step 4 — Update again |
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
| /////////////////////////////////////////////////////////////////////////////// | |
| // ABOUT: A unity Shader .cginc to draw numbers in the fragment shader | |
| // AUTHOR: Freya Holmér | |
| // LICENSE: Use for whatever, commercial or otherwise! | |
| // Don't hold me liable for issues though | |
| // But pls credit me if it works super well <3 | |
| // LIMITATIONS: There's some precision loss beyond 3 decimal places | |
| // CONTRIBUTORS: yes please! if you know a more precise way to get | |
| // decimal digits then pls lemme know! | |
| // GetDecimalSymbolAt() could use some more love/precision |
OlderNewer