What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-27 17:30:32
merge sort algo
// @see https://www.youtube.com/watch?v=es2T6KY45cA&vl=en // @see https://www.cs.usfca.edu/~galles/visualization/ComparisonSort.html function merge(list, start, midpoint, end) { const left = list.slice(start, midpoint); const right = list.sli... Add solution -
Javascript 2022-03-27 11:55:30
github react starter disques
import React from 'react'; import PropTypes from 'prop-types'; const SHORTNAME = 'example'; const WEBSITE_URL = 'http://www.example.com'; function renderDisqus() { if (window.DISQUS === undefined) { var script = document.createElement('script'); ... Add solution -
Javascript 2022-03-05 09:55:02
react native text strings must be rendered within a text
For me the following code works fine, as long as this.state.error === undefined or it is not an empty string. render() { return ( <View> {this.state.error && <Text> Error message: {this.state.error} ... Add solution -
Other 2022-03-02 14:05:01
quicksort
// @see https://www.youtube.com/watch?v=es2T6KY45cA&vl=en // @see https://www.youtube.com/watch?v=aXXWXz5rF64 // @see https://www.cs.usfca.edu/~galles/visualization/ComparisonSort.html function partition(list, start, end) { const pivot = list[end... Add solution -
Javascript 2022-02-20 04:40:15
convert an image into Base64 string using JavaScript
function getBase64Image(src, callback, outputFormat) { const img = new Image(); img.crossOrigin = 'Anonymous'; img.onload = () => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); ... Add solution -
Javascript 2022-02-05 15:10:12
jquery deparam
/** * jQuery.deparam - The oposite of jQuery param. Creates an object of query string parameters. * * Credits for the idea and Regex: * http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/ */ (function($){ $.d... Add solution -
Javascript 2021-11-21 16:55:18
javascript if browser out of focus
var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support hidden = "hidden"; visibilityChange = "visibilitychange"; } else if (typeof document.msHidden !==... Add solution
Best helpers
Ranking is empty