- Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
- pathname - The "file/directory" portion of the URL, like
invoices/123
- search - The stuff after
?
in a URL like/assignments?showGrades=1
. - query - A parsed version of search, usually an object but not a standard browser feature.
- hash - The
#
portion of the URL. This is not available to servers inrequest.url
so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things. - state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
- pathname - The "file/directory" portion of the URL, like
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_name HBHTTPRangeDownloader | |
signal download_finished | |
enum STATE { | |
STATE_READY, | |
STATE_BUSY | |
} | |
var download_url := "" |
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
extends KinematicBody2D | |
export var move_speed = 200.0 | |
var velocity := Vector2.ZERO | |
export var jump_height : float | |
export var jump_time_to_peak : float | |
export var jump_time_to_descent : float |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
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
import React from 'react'; | |
class ReducerComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
reducer = (state, action) => state; | |
dispatch = action => this.setState(state => this.reducer(state, action)); |
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
# Please credit "Ghouly The Ghost" out of your kind heart! Check my gist page for a license. | |
# Includes: No slip inclines, variable angle climbing, shape agnostic implementation, slope climb up/down, smooth old school vertical collisions | |
# WARNING! IMPORTANT!: Relies on " Scene >> Projects Settings >> Physics 2D >> motion_fixed_enabled[x] __ on[x]" | |
extends KinematicBody2D | |
const floorCheckVector = Vector2( 0, 1 ) | |
const normalCheckVector = Vector2( 0, -1 ) | |
var angleThreshold = 1.39 setget set_angle_threshold | |
var slopeScale = tan( angleThreshold ) |
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
// see also https://www.npmjs.com/package/subtractiontype.ts | |
// for literal unions | |
type Sub0< | |
O extends string, | |
D extends string, | |
> = {[K in O]: (Record<D, never> & Record<string, K>)[K]} | |
type Sub< |
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
/** | |
A little bare-bones drake calculator whipped together in ten minutes just to test some values and have fun. | |
Should work in all modern browsers. | |
**/ | |
function createDrake(element){ | |
if(!element){element = document.body;} | |
const container = document.createElement('div'); | |
container.id = 'drake'; |
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
// ==UserScript== | |
// @version 1.4.1 | |
// @name Hide watched videos on YouTube | |
// @icon https://www.youtube.com/favicon.ico | |
// @match https://www.youtube.com/* | |
// @exclude https://www.youtube.com/embed/* | |
// @exclude https://www.youtube.com/api/* | |
// @namespace https://gist.github.com/xPaw/6324624 | |
// @updateURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js | |
// @downloadURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js |