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
{ | |
"C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "sameLine", | |
"C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "sameLine", | |
"C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": "sameLine", | |
"C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine", | |
"C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine", | |
"C_Cpp.clang_format_fallbackStyle": "{ BasedOnStyle: Google }", | |
} |
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
export interface JsonMap<T> { | |
[key: string]: T; | |
} | |
export interface TransitionJson { | |
delayMillis: number; | |
bidirectional?: boolean; | |
} |
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
#ifndef STRUTILS_C | |
#define STRUTILS_C 1 | |
#ifndef str | |
#define str char * | |
#endif | |
#include <stdlib.h> | |
#include <stdbool.h> |
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
const DEG2RAD = Math.PI / 180; | |
const perimeter = { | |
square (radius) { | |
return radius * 2 * 4; | |
}, | |
circle (radius) { | |
return Math.PI * 2 * radius; | |
}, |
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
/*Sample an image at a reduced resolution*/ | |
vec4 pixelate ( in sampler2D sampler, in vec2 uv, in float divs ) { | |
return texture(sampler, | |
vec2( | |
floor( uv.x * divs ), | |
floor( uv.y * divs ) | |
) / divs | |
); | |
} |
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
/**Linear interpolation between from and to, using 0.0 - 1.0 interpolant `by`*/ | |
export const lerp = (from: number, to: number, by: number): number => { | |
return from*(1-by)+to*by; | |
} | |
/**Performs the inverse of lerp | |
* Will give you the interpolant given the interpolated number and its bounds (to and from) | |
*/ | |
export const inverseLerp = (from: number, to: number, value: number): number => { |
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 | |
# example usage: ` ./user-kick jon ` - kicks 'jon' pts sessions off | |
# this works by mapping username to pts port, then pts port to process id, and killing the process with kill -9 | |
# commands run: | |
# 'who' - for finding pts ports | |
# 'grep' - for filtering command output | |
# 'ps' - for listing processes by their pts port | |
# 'kill' - for terminating the process ids |
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
/**Linear interpolation between from and to, using 0.0 - 1.0 interpolant `by`*/ | |
export const lerp = (from: number, to: number, by: number): number => { | |
return from*(1-by)+to*by; | |
} | |
/**Performs the inverse of lerp | |
* Will give you the interpolant given the interpolated number and its bounds (to and from) | |
*/ | |
export const inverseLerp = (from: number, to: number, value: number): number => { | |
return (value - from) / (to - from); |
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
class OWOTPos { | |
static TileWidth = 16; | |
static TileHeight = 8; | |
constructor() { | |
this.tileX = 0; | |
this.tileY = 0; | |
this.charX = 0; | |
this.charY = 0; | |
this.x = 0; |
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
function sphere (worldname, x, y, z, diameter, clearMethod) { | |
var Material = org.bukkit.Material; | |
if (clearMethod === undefined) clearMethod = "none"; | |
var r = diameter/2; | |
var w = server.getWorld(worldname); | |
if (!w) throw "No world by name of " + worldname; | |
var b = w.getBlockAt(x, y, z); | |
var bl = b.getLocation(); | |
var bv = bl.toVector(); |