"use strict";
function doAsyncThing() {
let p = new Promise((resolve, reject) => process.nextTick(resolve)).then(() => {
console.log('after resolve', new Error().stack);
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
//clang 3.8.0 | |
#include <iostream> | |
// Option type and Result type implementations (tagged unions). | |
enum class OptionType { Some, None }; | |
template<typename T> | |
struct Option |
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 <libudev.h> | |
#define MAX_KBD_DEVICES 10 | |
const char** detect_kbd_devices() | |
{ | |
const char **devnodes = calloc(MAX_KBD_DEVICES, sizeof(char*)); | |
struct udev *udev; | |
struct udev_enumerate *enumerate; | |
struct udev_list_entry *devices, *dev_list_entry; | |
struct udev_device *dev; |
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
AXIS_UP ignore | |
AXIS_DOWN ignore | |
AXIS_LEFT ignore | |
AXIS_RIGHT ignore | |
MOUSE_BTN3 add volume 5 | |
MOUSE_BTN4 add volume -5 | |
MOUSE_BTN5 seek -5 | |
MOUSE_BTN6 seek 5 |
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
/*============================================================================ | |
NVIDIA FXAA 3.11 by TIMOTHY LOTTES | |
------------------------------------------------------------------------------ | |
COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED. | |
------------------------------------------------------------------------------ | |
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED |
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 <windows.h> | |
extern "C" | |
{ | |
#pragma section(".CRT$XIA",long,read) | |
#pragma section(".CRT$XIZ",long,read) | |
#pragma section(".CRT$XCA",long,read) | |
#pragma section(".CRT$XCZ",long,read) | |
#pragma section(".CRT$XPA",long,read) | |
#pragma section(".CRT$XPZ",long,read) |
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
// Mixin like functionality | |
const textInput = props => ` | |
color: ${props.error ? color.white : color.base}; | |
background-color: ${props.error ? color.alert : color.white}; | |
`; | |
export const Input = styled.input` | |
${textInput} | |
`; |
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
// Copyright (c) 2016 StagPoint Software | |
namespace StagPoint.Networking | |
{ | |
using System; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
/// <summary> | |
/// Provides some commonly-used functions for transferring compressed data over the network using |
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
//-------------------------------------- | |
//--- 010 Editor Binary Template | |
// | |
// File: FSB5.bt | |
// Author: Simon Pinfold | |
// Purpose: Parses the FSB5 (v0 and v1) audio container. | |
//-------------------------------------- | |
BitfieldDisablePadding(); |
My preferred code style is 2-space K&R. This is intended to provide a justification for this style.
K&R style has the following properties:
- Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
- Forces no empty or meaningless lines, thereby avoiding artificial distance between related things that should be together.
- Consumes the minimum vertical space while keeping the opening and closing syntax of a block on separate lines from the content.