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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # Modified. | |
| # Original script source: | |
| # http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html | |
| # https://web.archive.org/web/20150312172727/http://blog.marcbelmont.com/2012/10/script-to-extract-email-attachments.html | |
| # Usage: | |
| # Run the script from a folder with file "all.mbox" |
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
| // Port of some collision functions to Odin by Jakub Tomšů. | |
| // | |
| // from Real-Time Collision Detection by Christer Ericson, published by Morgan Kaufmann Publishers, © 2005 Elsevier Inc | |
| // | |
| // This should serve as an reference implementation for common collision queries for games. | |
| // The goal is good numerical robustness, handling edge cases and optimized math equations. | |
| // The code isn't necessarily very optimized. | |
| // | |
| // There are a few cases you don't want to use the procedures below directly, but instead manually inline the math and adapt it to your needs. | |
| // In my experience this method is clearer when writing complex level queries where I need to handle edge cases differently etc. |
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
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
- Copy/paste
rlmu.odininto an rlmu/ folder in your Odin project - Import rlmu package
import "rlmu" - Import microui package
import mu "vendor:microui" - Call rlmu lifecycle procs like so:
main :: proc() {
rl.SetWindowState({ rl.ConfigFlag.WINDOW_RESIZABLE })
rl.InitWindow(720, 600, "Odin/Raylib/microui Demo")This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/
the command zig run my_code.zig will compile and immediately run your Zig
program. Each of these cells contains a zig program that you can try to run
(some of them contain compile-time errors that you can comment out to play
with)
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
| package main | |
| import "core:fmt" | |
| import "core:math" | |
| import "core:math/linalg" | |
| import rl "vendor:raylib" | |
| main :: proc() { | |
| rl.SetConfigFlags({.VSYNC_HINT, .WINDOW_RESIZABLE, .MSAA_4X_HINT}) | |
| rl.InitWindow(800, 600, "collision") |
It's a common confusion about terminal colours... Actually we have this:
- plain ascii
- ansi escape codes (16 colour codes with bold/italic and background)
- 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
- 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
If you love deploying websites using Github, but for some reason want to use your own server, this script might be exactly what you need.
- Put
github.phpsomewhere on your PHP-enabled web server, and make it accessible for the outside world. Let's say for now the script lives on http://example.com/github.php
NewerOlder