Skip to content

Instantly share code, notes, and snippets.

View benqy's full-sized avatar
💭
(1)

刺蛇狗毒爆 benqy

💭
(1)
View GitHub Profile
@NickDiMucci
NickDiMucci / BasicEntityCollision.cs
Last active May 16, 2021 06:54
Basic collision detection via ray casting in Unity.
public class BasicEntityCollision : IEntityCollision {
private Vector3 size;
private Vector3 center;
// Give a bit of space between the raycast and boxCollider to prevent ray going through collision layer.
private float skin = .005f;
private LayerMask collisionMask;
private LayerMask playerMask;
public bool OnGround { get; set; }
@julianshapiro
julianshapiro / IE.js
Last active August 2, 2017 01:02
Future-Proof IE Version Detection Without User Agent Sniffing
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
@julianshapiro
julianshapiro / RAF.js
Last active April 19, 2017 06:48
requestAnimationFrame Polyfill
var requestAnimationFrame = window.requestAnimationFrame || (function() {
var timeLast = 0;
return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
var timeCurrent = (new Date()).getTime(),
timeDelta;
/* Dynamically set the delay on a per-tick basis to more closely match 60fps. */
/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671. */
timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
@staltz
staltz / introrx.md
Last active March 29, 2024 06:13
The introduction to Reactive Programming you've been missing
@felipeochoa
felipeochoa / quill-blots.org
Created January 13, 2018 17:13
Notes to self on blots in quill

Quill Blots

There are four options for creating a custom blot:

——-——–+——-+

InlineBlock

——-——–+——-+

Embed

——-——–+——-+

Text