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"; | |
import { Input } from "antd"; | |
const NumberAlphaInput = (props) => { | |
const handleInputChange = (event) => { | |
const regex = /^[a-zA-Z0-9_]*$/; | |
if (event.target.value === "" || regex.test(event.target.value)) { | |
props.onChange(event.target.value); | |
} | |
}; |
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
jQuery.fn.isInViewport = function () { | |
let elementTop = jQuery(this).offset().top; | |
let elementBottom = elementTop + jQuery(this).outerHeight(); | |
let viewportTop = jQuery(window).scrollTop(); | |
let viewportBottom = viewportTop + jQuery(window).height(); | |
return elementBottom > viewportTop && elementTop < viewportBottom; | |
}; |
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
<?php | |
foreach(str_split(base64_decode('YOUR_ENCODED_PASS_HERE')) as $chr) | |
echo chr(((($chr = ord($chr)) << 1) & 0xFF) | ($chr >> (8 - 1))); |
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
var tableToExcel = (function () { | |
var uri = 'data:application/vnd.ms-excel;base64,', | |
template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>' | |
, base64 = function (s) { | |
return window.btoa(unescape(encodeURIComponent(s))) | |
} | |
, format = function (s, c) { | |
return s.replace(/{(\w+)}/g, function (m, p) { | |
return c[p]; | |
}) |
Dice rolling game, making use of dom and javascript basics to create an interactive game. Scores can be changed by typing a target score input input box at top. From a course created by https://www.udemy.com/the-complete-javascript-course/
A Pen by Harry Beckwith on CodePen.
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
function findAndReplace(searchText, replacement, searchNode) { | |
if (!searchText || typeof replacement === 'undefined') { | |
// Throw error here if you want... | |
return; | |
} | |
var regex = typeof searchText === 'string' ? | |
new RegExp(searchText, 'g') : searchText, | |
childNodes = (searchNode || document.body).childNodes, | |
cnLength = childNodes.length, | |
excludes = 'html,head,style,title,link,meta,script,object,iframe'; |
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
/** | |
* author Remy Sharp | |
* url http://remysharp.com/tag/marquee | |
*/ | |
(function ($) { | |
$.fn.marquee = function (klass) { | |
var newMarquee = [], | |
last = this.length; |
NewerOlder