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
/** | |
* Partial SPA | |
* Make some of your links load content via AJAX instead of a full page load | |
*/ | |
function partialSPA(config) { | |
const { | |
selectorWithContentAndLinks = "body", // Selector of the element containing the links and the content to replace | |
selectorToReplace = "body", // Selector of the element to replace | |
routes = [/./], // Routes to replace | |
reservedPaths = [], // Paths that should not be replaced |
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 }} - Echo content | |
{{ $var or 'default' }} - Echo content with a default value | |
{{{ $var }}} - Echo escaped content | |
{{-- Comment --}} - A Blade comment | |
@extends('layout') - Extends a template with a layout | |
@if(condition) - Starts an if block | |
@else - Starts an else block | |
@elseif(condition) - Start a elseif block | |
@endif - Ends a if block |
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
// Go to the page that redirects | |
// Execute in console | |
fetch('https://iwanttoremovethis.com', {method: 'post'}).then(() => {}) | |
// Enjoy ~ |
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
// This is the same checks as the HTML5 email input form field as outlined in the link below. | |
// Email regex | |
/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ | |
function isEmail(email) { | |
// https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address | |
const regex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; | |
return regex.test(email) | |
} |
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
const {Builder, By, Key, until, Origin} = require('selenium-webdriver'); | |
const JokeAPI = require('sv443-joke-api'); | |
const url = "https://discord.com/channels/708291410612322345/708293571236593725"; // Page to load | |
const channelTitle = "💬・chat" // Do document.title on the page in browser | |
const random = (length = 8) => { | |
return Math.random().toString(16).substr(2, length); | |
}; |
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
alert("Test script loaded"); |
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
// Rather than writing document.createElement() to create HTML attributes, this function will do it for you | |
const html = (string, ...props) => { | |
if(props.length) { | |
let interpolatedString = ""; | |
for(let i = 0; i < string.length; i++) { | |
if(props[i] !== undefined) { | |
interpolatedString += string[i] + props[i]; | |
} else { | |
interpolatedString += string[i]; |
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== | |
// @name Remove clarify box | |
// @namespace https://artulloss.dev | |
// @version 0.1 | |
// @description Block youtubes "clarify box" | |
// @author artulloss | |
// @match https://*.youtube.com/* | |
// @grant none | |
// @updateURL | |
// @license MIT |
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 | |
const PATTERN = '~" translate="no">(.+)<\/a><\/div>~'; | |
$time = time(); | |
$today = strtotime(date('Y-m-d', $time)); | |
$dateTime = (new DateTime())->setTimestamp($time - $today); |
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
rm PocketMine-MP.phar.old 2> /dev/null | |
mv ./PocketMine-MP.phar ./PocketMine-MP.phar.old | |
echo "Backup of old Pocketmine-MP.phar stored at Pocketmine-MP.phar.old" | |
if [ $# -eq 0 ] # Empty arguments | |
then | |
curl -s https://api.github.com/repos/pmmp/Pocketmine-MP/releases/latest \ | |
| grep "browser_download_url.*phar" \ | |
| cut -d : -f 2,3 \ | |
| tr -d \" \ | |
| wget -qi - |
NewerOlder