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
// https://flatuicolors.com/palette/ca | |
const colors = ["#ff9ff3", "#feca57", "#ff6b6b", "#48dbfb", "#1dd1a1"]; | |
window.addEventListener("mousedown", (e) => { | |
const color = colors.shift(); | |
document.documentElement.style.setProperty("--highlight-color", color); | |
colors.push(color); | |
}); |
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 <stdio.h> | |
#include <stdint.h> | |
static uint8_t reg[4] = {0x0, 0x0, 0x0, 0x0}; | |
void reset() | |
{ | |
for (uint8_t i = 0; i < 4; ++i) | |
{ | |
reg[i] = 0x0; |
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
class Foo { | |
constructor() { | |
print("Foo has been constructed\n") | |
} | |
</ min = 0, max = 5 /> | |
function test(i) { | |
local min = Foo.getattributes("test").min | |
local max = Foo.getattributes("test").max | |
return i < min ? min : (i > max ? max : i) |
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
tell application "Messages" | |
set myid to get id of first service | |
set mybuddy to buddy "+11234567890" of service id myid | |
set message to "" | |
repeat 10000 times | |
set message to message & "😘" | |
end repeat | |
send message to mybuddy |
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
function uuid4() { | |
local fn = function(c) { | |
local r = (((1.0 * rand() / RAND_MAX) * 16) + 1).tointeger(); | |
local v = (c == "x") ? r : (r & 0x3 | 0x8); | |
return format("%x", r); | |
} | |
local string = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"; | |
local expression = regexp(@"[xy]"); | |
local captures = expression.capture(string); |
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
static SQRegFunction reg[] = { | |
// I believe the main reason this fails is due to the arguments. | |
// but when looking at DXSquirrel (specifically DXSquirrel_Device.cpp) there's nothing special done about it. | |
{ "getData", wrap_getData, 2, _SC("ts") }, | |
{ "getTestData", wrap_getTestData, NULL, NULL }, | |
{ 0, 0 } | |
}; | |
int wrap_getData(SQVM* v) { |
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
// C/C++ | |
#include <fstream> | |
#include <iostream> | |
#include <math.h> | |
// OpenGL | |
#include "opengl.h" | |
// utility | |
#include "matrix4.h" |
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 <iostream> | |
#include "module.h" | |
class MyModule : public Module { | |
DECLARE_MODULE(Module::M_TYPE_ONE); | |
public: | |
MyModule() {} | |
}; | |
REGISTER_MODULE(MyModule); |
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
import os | |
from shutil import copyfile | |
library_string = "" | |
root = "src" | |
header = (".h", ".hpp") | |
impl = (".c", ".cc", ".cpp") | |
variables = [] |
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
import os | |
from fnmatch import fnmatch | |
# pretty useless if youre using git. | |
root = "./" | |
search = ["._*", ".DS_Store", ".AppleDouble", ".LSOverride"] | |
for (path, dirs, files) in os.walk(root): |
NewerOlder