# show full usage
$ ./glitch -h
# create some glitch art
$ ./glitch [-o <output.png>] -i <input.(png|jpg)> [-expression <some fancy expression>]
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 ( | |
| "os" | |
| "io" | |
| "github.com/hajimehoshi/oto" | |
| "github.com/sugoiuguu/go-exit" | |
| ) |
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 <unistd.h> | |
| #include "goio.h" | |
| #define RWCPY_BUFSIZ 4096 | |
| int rwcpy(wfun_t wf, void *dst, rfun_t rf, void *src) | |
| { | |
| static char buf[RWCPY_BUFSIZ]; | |
| return rwcpy_r(wf, dst, rf, src, buf, RWCPY_BUFSIZ); |
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 ( | |
| "os" | |
| "fmt" | |
| "time" | |
| "flag" | |
| "sync" | |
| "image" | |
| "image/png" |
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 <iostream> | |
| #include <vector> | |
| #include <functional> | |
| #include <cstdio> | |
| #define DEFER(CTX, EXPR) (CTX)->defer([&]() {EXPR;}) | |
| class DeferCtx { | |
| std::vector<std::function<void ()>> deferred; |
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> | |
| #include <string.h> | |
| #include "metaswitch.h" | |
| int intcmp(const void *x, const void *y) | |
| { | |
| return *(int *)x - *(int *)y; | |
| } |
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 ( | |
| "os" | |
| "io" | |
| "fmt" | |
| "unicode" | |
| ) | |
| type ASTNode interface { |
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> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <windows.h> | |
| // cc -Wall -O2 -o pick.exe pick.c -lcomdlg32 | |
| COLORREF fromhexstr(const char *hex) | |
| { | |
| COLORREF color = 0; |
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 | |
| /* | |
| typedef struct { | |
| int x, y; | |
| } Point; | |
| void init_pt(Point *p, int x, int y) | |
| { | |
| p->x = x; |
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 ( | |
| "io" | |
| "net" | |
| "flag" | |
| "sync" | |
| "crypto/tls" | |
| ) |
