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
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 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 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 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 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 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 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> |
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 <libgen.h> | |
#include <linux/limits.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
static const char MARKER_FILE[] = "build.ninja"; | |
static bool exe_in_build_dir(void) |
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
{-# LANGUAGE TypeFamilies, DataKinds, ConstraintKinds #-} | |
{-# LANGUAGE GADTs, EmptyCase, StandaloneDeriving #-} | |
{-# LANGUAGE TypeOperators, PatternSynonyms #-} | |
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-} | |
module Main where | |
-- * Void Datatype | |
data Void |
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
#!/usr/bin/env python3 | |
import sys | |
from PyQt5.QtCore import pyqtSlot | |
from PyQt5.QtWidgets import QApplication, QDialog | |
from PyQt5.uic import loadUi | |
class FooWindow(QDialog): |