$ curl -LJO https://github.com/raysan5/raylib/releases/download/3.0.0/raylib-3.0.0-Linux-amd64.tar.gz$ tar zxvf raylib-3.0.0-Linux-amd64.tar.gz
$ cd raylib-3.0.0-Linux-amd64
$ mkdir ~/local/raylib3.0.0| CLIENT_ID="****" | |
| CLIENT_SECRET="****" | |
| USER_NAME="****" | |
| USER_PASSWORD="****" | |
| curl -X POST -A "User agent" -d "grant_type=password&username=$USER_NAME&password=$USER_PASSWORD" --user "$CLIENT_ID:$CLIENT_SECRET" https://www.reddit.com/api/v1/access_token | |
| # output | |
| # {"access_token": "****", "token_type": "bearer", "expires_in":3600, "scope": "*"} |
| # width not divisible by 2 というエラーが出る場合は -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" を追加する | |
| ffmpeg -loop 1 -i blue.jpg -i ~/Desktop/aa.mp3 -shortest -b:a 320000 -pix_fmt yuv420p -vcodec libx264 out.mp4 | |
| # そもそもアップロードできない | |
| # ffmpeg -loop 1 -i black.jpg -i input.mp3 -shortest -b 1000k -vcodec libx264 out.mp4 | |
| # これだとtwitterでは音がきこえなかった | |
| # ffmpeg -loop 1 -i black.jpg -i input.mp3 -shortest -b 1000k -acodec copy out.mp4 |
| # https://github.com/raysan5/raylib/blob/3.0.0/examples/physics/physics_demo.c | |
| import raylib | |
| {.define: PHYSAC_NO_THREADS.} | |
| include raylib/physac | |
| const | |
| screenWidth = 800 | |
| screenHeight = 450 |
| --- Makefile.org 2020-10-30 12:21:35.708751677 +0900 | |
| +++ Makefile 2020-10-30 12:25:05.313747229 +0900 | |
| @@ -574,15 +574,15 @@ | |
| raygui.o : raygui.c raygui.h gui_textbox_extended.h ricons.h | |
| $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -DRAYGUI_IMPLEMENTATION | |
| raygui.c: | |
| - echo '#define RAYGUI_IMPLEMENTATION' > raygui.c | |
| echo '#include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h"' >> raygui.c | |
| # Compile physac module |
| # https://github.com/raysan5/raylib/blob/3.0.0/examples/models/models_first_person_maze.c | |
| # | |
| # $ cd examples/models | |
| # $ nim r -p:../../src models_first_person_maze.nim | |
| import raylib | |
| proc free(p: pointer) {. | |
| importc, header: "<stdlib.h>".} |
| import strutils | |
| # Go version: https://github.com/prologic/monkey-lang/blob/master/parser/parser_tracing.go | |
| # | |
| # when defined(trace): import ./parser_tracing | |
| # [...] | |
| # proc parseProgram(p: var Parser): PNode = | |
| # when defined(trace): TRACE("parseProgram") | |
| # | |
| # $ nim r -d:trace src/parser.nim |
| import | |
| sdl2/sdl, | |
| sdl2/sdl_ttf as ttf | |
| const | |
| Title = "SDL2 App" | |
| ScreenW = 640 # Window width | |
| ScreenH = 480 # Window height | |
| WindowFlags = 0 | |
| RendererFlags = sdl.RendererAccelerated or sdl.RendererPresentVsync |
| import nimsvg | |
| const numFrames = 250 | |
| type | |
| Move = enum | |
| Up, Right, Down, Left | |
| Obj = object | |
| x: float | |
| y: float |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="anime.min.js"></script> | |
| <style> | |
| body {background-color: #ddd;} | |
| </style> | |
| </head> | |
| <body></body> |