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
/* | |
* Minimal classList shim for IE 9 | |
* By Devon Govett | |
* MIT LICENSE | |
*/ | |
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') { | |
Object.defineProperty(HTMLElement.prototype, 'classList', { | |
get: function() { |
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 <windows.h> | |
#include "extern/png/png.h" | |
#include <stdio.h> | |
BOOL SaveToFilePng(HBITMAP hBitmap, LPCSTR lpszFileName) | |
{ | |
BITMAP Bitmap; | |
GetObject(hBitmap, sizeof(Bitmap), (LPSTR)&Bitmap); | |
unsigned int bitmap_bytes_per_pixel = 4; | |
unsigned int bitmap_scanline_size = (((Bitmap.bmWidth * bitmap_bytes_per_pixel) + (4 - 1)) & ~(4 - 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
""" | |
Python implementation of PKCS #7 padding. | |
RFC 2315: PKCS#7 page 21 | |
Some content-encryption algorithms assume the | |
input length is a multiple of k octets, where k > 1, and | |
let the application define a method for handling inputs | |
whose lengths are not a multiple of k octets. For such | |
algorithms, the method shall be to pad the input at the | |
trailing end with k - (l mod k) octets all having value k - |
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
#!/bin/bash | |
# 75-dual-home-routing | |
# Description: Updates routing tables to allow traffic on dual-homed boxes | |
# according to the interface it came in on | |
# Place in /etc/NetworkManager/dispatcher.d/ and update interface name below | |
IF=$1 | |
STATUS=$2 | |
function update_routing_table() { |
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
//------------------------------------------------------------------------------------------------------- | |
// constexpr GUID parsing | |
// Written by Alexander Bessonov | |
// | |
// Licensed under the MIT license. | |
//------------------------------------------------------------------------------------------------------- | |
#pragma once | |
#include <stdexcept> | |
#include <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
// if(MSVC) | |
// set(AVX2_FLAGS "/arch:AVX2") | |
// else() | |
// set(AVX2_FLAGS "-march=native -mavx2") | |
// endif() | |
// | |
// option(ENABLE_AVX2 "Enable AVX2 support" OFF) | |
// if(ENABLE_AVX2) | |
// if(CMAKE_CROSSCOMPILING) | |
// set(AVX2 TRUE) |
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 <string_view> | |
#include <exception> | |
#include <assert.h> | |
using namespace std::literals; | |
struct guid | |
{ | |
uint32_t Data1; | |
uint16_t Data2; |
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 "pch.h" | |
#pragma comment(lib, "gdi32.lib") | |
enum ZBID | |
{ | |
ZBID_DEFAULT = 0, | |
ZBID_DESKTOP = 1, | |
ZBID_UIACCESS = 2, | |
ZBID_IMMERSIVE_IHM = 3, | |
ZBID_IMMERSIVE_NOTIFICATION = 4, |
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 <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// munged from https://github.com/simontime/Resead | |
namespace sead | |
{ | |
class Random | |
{ |
OlderNewer