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 <SDL2/SDL.h> | |
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav" | |
// prototype for our audio callback | |
// see the implementation for more information | |
void my_audio_callback(void *userdata, Uint8 *stream, int len); | |
// variable declarations | |
static Uint8 *audio_pos; // global pointer to the audio buffer to be played |
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; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
struct Triangle { | |
public int p1; | |
public int p2; | |
public int p3; | |
public Triangle(int point1, int point2, int point3) { |
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 simple CMake script for building the application. | |
cmake_minimum_required(VERSION 2.8) | |
project(create-x509) | |
# Our only dependency is OpenSSL | |
find_package(OpenSSL REQUIRED) | |
include_directories(${OPENSSL_INCLUDE_DIR}) | |
add_executable(create-x509 create-x509.cpp) |
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
// NOTICE 2020-04-18 | |
// Please see the comments below about why this is not a great PRNG. | |
// Read summary by @bryc here: | |
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
// Have a look at js-arbit which uses Alea: | |
// https://github.com/blixt/js-arbit | |
/** |
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
/** | |
* Recursive shadowcasting algorithm. | |
* This algorithm creates a field of view centered around (x, y). | |
* Opaque tiles are treated as if they have beveled edges. | |
* Transparent tiles are visible only if their center is visible, so the | |
* algorithm is symmetric. | |
* @param cx - x coordinate of center | |
* @param cy - y coordinate of center | |
* @param transparent - function that takes (x, y) as arguments and returns the transparency of that tile | |
* @param reveal - callback function that reveals the tile at (x, y) |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
// File Format: | |
// https://github.com/aseprite/aseprite/blob/master/docs/ase-file-specs.md | |
// Note: I didn't test with with Indexed or Grayscale colors |
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
Basic Manual for DaFit Fitness Tracker firmware update protocol, works for nearly any nRF52832 tracker from Company DaFit | |
The minimum size of update file is 0x10000(can be filled with garbage to get to size) and the maximum size is 0x2F000 | |
the update will first get stored onto the external flash at position 0x3D1000 by the stock firmware(not by the bootloader) | |
the size of the update will get stored at 0x3D0000 on external flash with 4 bytes uint32_t | |
when bootloader gets activated it will copy the update from external flash to 0x23000 of the nRF52 internal flash. | |
Connect to device, |