Skip to content

Instantly share code, notes, and snippets.

View ryanwebjackson's full-sized avatar

Ryan Jackson ryanwebjackson

View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active August 11, 2025 02:26
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@DanDiplo
DanDiplo / JS-LINQ.js
Last active August 10, 2025 14:59
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
git stash
git stash list
git stash apply
git stash drop
@JoshCheek
JoshCheek / quiz.md
Last active August 29, 2015 14:17
HTTP quiz!

Quiz time!

  • What does the dot mean in in StringIO.new, what does the hash mean in StringIO#puts?
  • How do you make a String literal?
  • How do you make a String without using a literal?

This is an HTTP request, it is a String that is sent across a Socket, which your program can read from as if it were a file or $stdin.

01 POST /users/5?omg=wtf&bbq=lol HTTP/1.1\r\n
var launchArgs = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData ?? args
@WebReflection
WebReflection / one.js
Created March 7, 2015 19:42
A simple one file technique to bring JS on the client and the server
/** server */
var
port = 3000,
server = require('http').createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('<!DOCTYPE html>'.concat(
'<html>',
'<head>',
'<script>(', client, ').call(this);</script>',
'</head>',
@ericelliott
ericelliott / essential-javascript-links.md
Last active June 14, 2025 18:43
Essential JavaScript Links
@jgarber623
jgarber623 / delicious.html
Created December 2, 2014 06:07
A sample of the Netscape Bookmark File Format as exported from Delicious.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#//apple_ref/doc/-%20uid/TP40014508" ADD_DATE="1414706885" PRIVATE="0" TAGS="javascript,mac,osx,yosemite">JavaScript for Automation Release Notes</A>
<DD>This article describes JavaScript for Automation, a new feature in OS X Yosemite.
#Development Machine v1.0b
cmd START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/ThaddParker/543228b70fdafcee8183/raw/640f03295ce3274f870ee6f1754e9c13c070f0a6/webdev1
#create the Temp directory
$checkDir = Test-Path -PathType Container Temp
if($checkDir -eq $false){
New-Item 'Temp' -type Directory
}
# create the projects directory
@jwood803
jwood803 / FSharpBankAccount.fs
Last active November 1, 2017 21:01
Code examples for F# in the Enterprise blog post.
type BankAccount() =
member val Balance = Option<float>.None with get, set
member this.openAccount() =
this.Balance <- Some 0.0
this.Balance.Value
member this.closeAccount() =
this.Balance <- None