Skip to content

Instantly share code, notes, and snippets.

🔥
Burnout

Andrew Luca iamandrewluca

🔥
Burnout
Block or report user

Report or block iamandrewluca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iamandrewluca
iamandrewluca / open-localhost.js
Last active Apr 15, 2020
open any URL with host as localhost:3000 #bookmarklet
View open-localhost.js
javascript: void((function () {
/**
* Add your own mappers, first found will be used
* @type {{host: string, startsWith: string}[]}
*/
const hostMapper = [
{ startsWith: 'https://example.org', host: 'localhost:3000' },
{ startsWith: 'https://example.org/admin', host: 'localhost:3001' },
];
@iamandrewluca
iamandrewluca / shrug.js
Created Apr 14, 2020
Shrug text emoji #bookmarklet
View shrug.js
javascript: void(function() {
const all = [
"¯\\_(ツ)_/¯",
"¯\\(ツ)/¯",
"ʅ(ツ)ʃ",
"乁(ツ)ㄏ",
"乁(ツ)∫",
"ƪ(ツ)∫",
"¯\\_₍ッ₎_/¯",
"乁₍ッ₎ㄏ",
@iamandrewluca
iamandrewluca / table-flip.js
Created Apr 14, 2020
Random table flip text emoji #bookmarklet
View table-flip.js
javascript: void(function() {
const all = [
"(╯°□°)╯︵ ┻━┻",
"(┛◉Д◉)┛彡┻━┻",
"(ノ≧∇≦)ノ ミ ┸━┸",
"(ノಠ益ಠ)ノ彡┻━┻",
"(╯ರ ~ ರ)╯︵ ┻━┻",
"(┛ಸ_ಸ)┛彡┻━┻",
"(ノ´・ω・)ノ ミ ┸━┸",
"(ノಥ,_」ಥ)ノ彡┻━┻",
@iamandrewluca
iamandrewluca / duplicate-id-finder.js
Last active Apr 6, 2020
Find and mark elements with on page which have duplicate IDs
View duplicate-id-finder.js
javascript: void ((function() {
const ids = document.querySelectorAll('[id]');
Array.from(ids).forEach(el => {
const id = document.querySelectorAll(`[id="${el.id}"]`);
if (id.length > 1 && id[0] === el) {
console.log('Duplicate id ' + el.id);
Array.from(id).forEach(fel => {
fel.style.outline = '5px solid red';
});
alert('duplicate found');
@iamandrewluca
iamandrewluca / request-picture-in-picture.js
Last active May 21, 2020
Request picture in picture on first found video that is playing #bookmarklet
View request-picture-in-picture.js
javascript: void ((function() {
/** @type {NodeListOf<HTMLIFrameElement>} */
const iFrames = window.document.querySelectorAll('iframe');
/** @type {Document[]} */
const allDocuments = [
window.document,
...Array.from(iFrames)
.map(i => i.contentDocument)
/**
@iamandrewluca
iamandrewluca / password-toggler.js
Last active Apr 1, 2020
Toggle password inputs to text back and forth #bookmarklet
View password-toggler.js
javascript: void ((function() {
const passwordInputs = document.querySelectorAll('[type="password"], [data-password-bookmark-toggled]');
Array.from(passwordInputs).forEach(e => {
if (e.getAttribute('data-password-bookmark-toggled')) {
e.removeAttribute('data-password-bookmark-toggled');
e.setAttribute('type', 'password');
} else {
e.setAttribute('data-password-bookmark-toggled', true);
e.setAttribute('type', 'text');
}
View yellowpages.md.java
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.apache.commons.csv.CSVRecord;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.io.*;
import java.net.*;
View count-duplicates.lisp
(defun cod (list &optional acc)
(cond
((null list) (reverse acc))
(T (cod
(remove (car list) list)
(cons
(cons
(count (car list) list)
(cons (car list) nil)
View join-jsx.js
import React from "react";
import ReactDOM from "react-dom";
function App() {
return (
<div>
<hr />
{joinJSX(
[
<span key={3}>1</span>,
View uses-schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "/uses schema validation",
"type": "array",
"items": { "$ref": "#/definitions/page" },
"definitions": {
"page": {
"type": "object",
"properties": {
"name": { "type": "string" },
You can’t perform that action at this time.