Skip to content

Instantly share code, notes, and snippets.

View kushsolitary's full-sized avatar
🏠
Working from home

Kushagra Agarwal kushsolitary

🏠
Working from home
View GitHub Profile
@warrenm
warrenm / CommonProfile.metal
Created November 14, 2019 01:29
SceneKit's CommonProfile Shader v2 (macOS 10.15)
////////////////////////////////////////////////
// CommonProfile Shader v2
#import <metal_stdlib>
using namespace metal;
#ifndef __SCNMetalDefines__
#define __SCNMetalDefines__
@colejd
colejd / ModalView.swift
Last active August 9, 2023 03:05
NSView that closes itself when clicking outside
// MIT License - © 2017 Jonathan Cole.
import Cocoa
/**
A view with the ability to hide itself if the user clicks outside of it.
*/
class ModalView: NSView {
private var monitor: Any?
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];