Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View brimelow's full-sized avatar
🖤
After Effects Prototyping

Lee Brimelow brimelow

🖤
After Effects Prototyping
  • Adobe
  • San Francisco Bay Area
View GitHub Profile
@brimelow
brimelow / EasingEquations.swift
Created June 16, 2019 04:49
SwiftUI Animation Easing Extension
//
// EasingEquations.swift
// DrawingGroup
//
// Created by Lee Brimelow on 6/15/19.
// Copyright © 2019 Lee Brimelow. All rights reserved.
//
import SwiftUI
@brimelow
brimelow / ContentView.swift
Created June 13, 2019 07:51
Random 100 Circles Animation in SwiftUI
//
// ContentView.swift
// DrawingGroup
//
// Created by Lee Brimelow on 6/12/19.
// Copyright © 2019 Lee Brimelow. All rights reserved.
//
import SwiftUI
@brimelow
brimelow / devtoolscontext.html
Created June 4, 2013 20:23
Google developer tools HTML-based native context menu.
<style>
.soft-context-menu-glass-pane {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 20000;
}
@brimelow
brimelow / jquery-dom-native.js
Created May 19, 2013 00:41
jQuery DOM - Native equivalents
//----Append some HTML elements----
// jQuery
$(document.body).append("<div id='myDiv'><img src='im.gif'/></div>");
// native equivalent (BAD WAY)
document.body.innerHTML += "<div id='myDiv'><img src='im.gif'/></div>";
// native equivalent (BEST WAY)
var frag = document.createDocumentFragment();
@brimelow
brimelow / jquery-selectors-vs-native.js
Last active March 9, 2019 21:27
Native equivalents to jQuery selectors
//----Get all divs-----------------
// jQuery
$("div")
// native equivalent
document.getElementsByTagName("div")
//----Get all by CSS class---------
@brimelow
brimelow / jQuery_class_methods.js
Last active December 17, 2015 11:39
Native alternatives for jQuery class methods
// get reference to DOM element
var el = document.querySelector(".main-content");
//----Adding a class------
// jQuery addClass
$(el).addClass("someClass");
// native equivalent
el.classList.add("someClass");
@brimelow
brimelow / jquery_css_vs_dom.js
Last active December 17, 2015 11:39
Performance difference between using jQuery.css() and the standard DOM style properties.
// get reference to a DOM element
var el = document.querySelector(".main-content");
// set some styles using jQuery.css()
$(el).css({
background: "#FF0000",
"box-shadow": "1px 1px 5px 5px red",
width: "100px",
height: "100px",
display: "block"