- Install
msys2
(because we needmingw64
,gcc
andlibws2_32.a
) - Open
msys2
ormingw64
and runpacman -S mingw64/mingw-w64-x86_64-mruby
- Get MRuby and extract the folder
- Run
make
inside the foldermruby-3.3.0
, there will be a new folder called/build
after the compilation, we need the file at/build/host/lib/libmruby.a
- Compile using the following command
gcc main.c -I"mruby-3.3.0/include" "mruby-3.3.0/build/host/lib/libmruby.a" "C:\msys64\mingw64\lib\libws2_32.a" -lm -o main
or substitue"C:\msys64\mingw64\lib\libws2_32.a"
with-lws2_32
- Run the compiled binary
main.exe
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
# frozen_string_literal: true | |
# Put me in a folder where you want to bulk rename every folder | |
# In this case, this script will rename every folder from "Photos from YEAR" to "YEAR" only | |
# Run: ruby bulk_rename.rb | |
folders = Dir.entries('.').reject { ['.', '..'].include? _1 } | |
folders.each do |folder| | |
File.rename(File.join(Dir.pwd, folder), File.join(Dir.pwd, folder.delete_prefix("Photos from "))) | |
end |
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
# frozen_string_literal: true | |
# Put me in a folder where you want to get rid of all the subfolders | |
# Run: ruby flatten.rb | |
def move_and_delete(dir) | |
puts "Cleaning \"#{dir}\"" | |
Dir.foreach(dir) do |file| | |
next if ['.', '..'].include?(file) |
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
#include <math.h> | |
typedef float f32; | |
typedef struct Vector2 | |
{ | |
f32 x, y; | |
} Vector2; | |
typedef SDL_FRect RectangleF; | |
typedef struct Circle |
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
typedef uint8_t u8; | |
typedef uint16_t u16; | |
typedef uint32_t u32; | |
typedef uint64_t u64; | |
typedef size_t umax; | |
typedef int8_t s8; | |
typedef int16_t s16; | |
typedef int32_t s32; |
Run: choco install msys
Symlink directory (some project assume its in C:\msys64): MKLINK /D "C:\msys64" "C:\tools\msys64"
Add the following path C:\msys64\usr\bin
to your PATH environment variable
Now you shoule be able to run pacman -Q
, choco list | sed s/msys2/test/g
, help | grep disk
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 7 in line 1.
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
2023;Jan;Feb;Mars;April;Maj;Juni;Juli;Aug;Sep;Okt;Nov;Dec | |
Södertörn;469,25;469,25;424,5;424,5;439;439;435;435;460;460;457,5;457,5 | |
Stockholm;497,5;497,5;425;425;460;460;465;465;529;529;485;485 | |
Nacka;-;-;520;520;449,75;449,75;455,25;455,25;462,5;462,5;470,25;470,25 | |
Solna;535;535;437,5;437,5;491,75;491,75;-;-;503,5;503,5;470;470 | |
Attunda;503;503;417,5;417,5;460,5;460,5;431,25;431,25;475;475;453,75;453,75 | |
2022;Jan;Feb;Mars;April;Maj;Juni;Juli;Aug;Sep;Okt;Nov;Dec | |
Södertörn;452,5;452,5;423,75;423,75;436;436;487,75;487,75;441,25;441,25;454,75;454,75 | |
Stockholm;498,5;498,5;482,5;482,5;470;470;453;453;477,5;477,5;475;475 | |
Nacka;463,5;463,5;426;426;426,5;426,5;-;-;452,5;452,5;440;440 |
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
def itob(number) | |
decimals = [] | |
while (number.positive?) | |
number, remainder = number.divmod(2) | |
decimals << remainder | |
end | |
bits = decimals.length.times.map { |i| 2**i } | |
validate_sum = 0 |
Can you crack the secret message hidden within this cipher? I've taken a phrase and encoded it into a string of words that look like "meatball". It's a bit tricky, but I believe in your skills!
Cipher Text:
mEaTbALLmEAtBALLmEATbALL, mEATBalLmEAtBALLmEATbAlL mEAtbalLmEATbaLlmEAtbAlL mEATbaLLmEATbAlLmEATballmEAtbAlLmEATbaLl mEATbaLLmEAtBAlLmEAtbalLmEATbaLlmEATbAll! mEaTbALLmEAtbalLmEAtBALlmEATbAll mEAtbalL mEAtBaLlmEAtBALLmEAtbaLl? mEaTbALLmEAtbAlL'mEATbaLlmEAtbAlL mEAtBallmEAtBalLmEATbaLlmEAtBalLmEAtBALlmEAtbALL: mEAtbalLmEAtBALlmEAtbAllmEATbaLlmEAtbAlLmEATbALL@mEAtbaLlmEAtbAlLmEATbAllmEATbALLmEAtBalLmEATBallmEATbAllmEAtBAllmEAtbalLmEAtbaLlmEATbaLL.mEAtbaLLmEAtBALLmEAtBAlL
NewerOlder