Skip to content

Instantly share code, notes, and snippets.

View hperantunes's full-sized avatar

Hilton Perantunes hperantunes

  • Montreal, Canada
View GitHub Profile
rem regular version
for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")
rem recursive
for /f "Tokens=*" %f in ('dir /l/b/a-d/s') do (rename "%f" "%f")
using System;
using System.Linq;
public class Program
{
public static void Main()
{
var a = new string[] { "something", "something else" };
var b = new string[] { "something", "something else" };
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test("something@something.media")
This file has been truncated, but you can view the full file.
<style>
@charset "UTF-8";@font-face{font-family:primeicons;font-display:auto;src:url(primeicons.9868d68fa1bf5f4b6119.eot);src:url(primeicons.9868d68fa1bf5f4b6119.eot?#iefix) format("embedded-opentype"),url(primeicons.e78e6d8e7dfc3a27e7ee.ttf) format("truetype"),url(primeicons.42a056b9cc42634d97e2.woff) format("woff"),url(primeicons.8ba12f803b137699ee74.svg?#primeicons) format("svg");font-weight:400;font-style:normal}.pi{font-family:primeicons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.pi:before{--webkit-backface-visibility:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden}.pi-fw{width:1.28571429em;text-align:center}.pi-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}@-webkit-keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes fa-spin{0%{transform:rotate(0deg)}to{transform:ro
// https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Opera 8.0+
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';
// Safari 3.0+ "[object HTMLElementConstructor]"
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));
var request = new XMLHttpRequest();
request.open('GET', '/bar/foo.txt', false); // `false` makes the request synchronous
request.send(null);
if (request.status === 200) {
console.log(request.responseText);
}
import { useEffect } from "react";
const useScript = (url) => {
useEffect(() => {
const script = document.createElement("script");
script.src = url;
script.async = true;
document.body.appendChild(script);
HttpUtility.ParseQueryString(Request.UrlReferrer?.Query ?? string.Empty)["lang"];
@hperantunes
hperantunes / disableBackHistory.js
Last active April 24, 2020 05:04
Disable page from going back in navigation history
history.pushState(null, document.title, location.href);
window.addEventListener('popstate', function (event) {
history.pushState(null, document.title, location.href);
});