DevSamples

DevSamples contains code samples for common problems in web development and general development. Take a look at the list of samples for any code snippets that you could include in your own projects. Language samples include: HTML, CSS, Javascript, XML, Typescript, React, Redux, git, etc. All code samples and dev samples allow you to copy them to your clipboard, and paste them into your own projects. We have dev samples for any need!
CSS

Forcing Line Breaks with CSS

Prevent lines of text such as long URLs from overflowing by forcing a line or word break.

CSSMethodologies

BEM CSS Methodology Example

A few code snippets demonstrating how to use the BEM methodology for CSS.

CSS

CSS Parallax Background Image

A small code sample showing how to use a fixed background attachment to create a parallax effect.

CSS

CSS Background Property Shorthand

A few code examples showing how to use the shorthand notation for the background property.

HTMLJavascriptjQuery

Using Data Attributes in Javascript

A couple code samples showing different ways to add and select elements via data attributes.

Javascript

Sending an Authorization Token Using Javascript Fetch

Code sample showing how to format fetch request headers to send a token with a request.

Source ControlGIT

Copy a File from One Branch to Another Using Git

A git command that will allow you to move a version of a file from one branch to another.

CSS

CSS Animation Property Shorthand

A few code examples showing how to use the shorthand notation for the animation property.

CSS

How to Override Inline CSS Styles

Code snippet showing how to override inline styles using CSS.

CSS

Text Shadows with CSS

Code snippet showing how to add shadows to text using CSS.

HTML

Add a Favicon to Your Website

A small code snippet demonstrating how to add a favicon to your website.

CSS

Sticky Items with CSS

Two code samples showing how to use the sticky value of the position property.

JavascriptES6

Javascript Debounce Function

Prevent a function from being called too many times using a debounce function.

CSS

Gradient Underline with CSS

CSS code sample for creating a gradient colored underline for a word or sentence.

CSS

How to Use the CSS Calc Function

A couple examples demonstrating how to use the CSS calc function in CSS and SCSS.

CSS

CSS Transition Property Shorthand

A few code examples showing how to use the shorthand notation for the transition property.

DevSamples | Code snippets for any need