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
--- | |
Language: Cpp | |
BasedOnStyle: LLVM | |
ColumnLimit: 120 | |
IndentWidth: 4 | |
Standard: Latest | |
TabWidth: 4 | |
UseTab: ForIndentation | |
AlignEscapedNewlines: Left |
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
#!/bin/bash | |
readonly payload='\ | |
foo abc xyz | |
bar def uvw' | |
while read one two three ; do | |
echo $one : $two : $three | |
done <<< $payload |
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
// Instructions: | |
// 1) Add NuGet: glfw-net | |
// 2) Download official GLFW DLL (pre-compiled): https://www.glfw.org/download.html | |
// 3) Copy DLL to $(TargetDir) so it can be loaded | |
// 4) Rename DLL to glfw.dll | |
using GLFW; | |
using System; | |
using System.Threading; |
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
void dump_kernels(size_t num_devices) | |
{ | |
size_t num_binaries = num_devices; | |
size_t *sizes = malloc(num_binaries * sizeof(sizes[0])); | |
assert(sizes); | |
clGetProgramInfo(clProgram, CL_PROGRAM_BINARY_SIZES, num_binaries * sizeof(sizes[0]), sizes, NULL); | |
unsigned char **binaries = malloc(num_binaries * sizeof(binaries[0])); | |
assert(binaries); |
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
def `(cmd) #` | |
stdout = Kernel.`(cmd) #` | |
raise "Command failed with status (#{$?.exitstatus}) '#{cmd}'" unless $?.success? | |
return stdout | |
end | |
puts `date`.split[1] |
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
; grid: w4rh4wk | |
[Groups] | |
NumberOfGroups = 99 | |
[1] | |
TriggerTop = -50 | |
TriggerBottom = -50 |
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
using UnityEngine; | |
public class CollisionLogger : MonoBehaviour | |
{ | |
void OnTriggerEnter() => Debug.Log("Trigger Enter"); | |
void OnTriggerStay() => Debug.Log("Trigger Stay"); | |
void OnTriggerExit() => Debug.Log("Trigger 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 <iostream> | |
#include <memory> | |
struct vec3 { | |
int x, y, z; | |
}; | |
std::ostream& operator<<(std::ostream& out, const vec3& v) | |
{ | |
return out << "vec3{" << v.x << ", " << v.y << ", " << v.z << "}"; |
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
a:#ifdef ... #endif:#ifdef: | |
#ifdef $condition$ | |
$selected$$end$ | |
#endif // $condition$ | |
a:Untitled:#in: | |
#include "$end$" | |
a:Untitled:#in: | |
#include <$end$> |
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
/* SDL RAII | |
* | |
* This file provides RAII wrappers for SDL objects. | |
* | |
*/ | |
#include <memory> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_image.h> |