Skip to content

Instantly share code, notes, and snippets.

Avatar
👮‍♂️
git inspector

Andrew Luca iamandrewluca

👮‍♂️
git inspector
View GitHub Profile
View App.tsx
import * as React from "react";
import "./styles.css";
import { useCountState, useCountDispatch } from "./count-context";
export default function App() {
const count = useCountState();
const dispatch = useCountDispatch();
return (
<div className="App">
{count}
@iamandrewluca
iamandrewluca / github-tab-size.js
Last active Sep 19, 2020
🔥🔥🔥 Change GitHub Tab Size #bookmarklet
View github-tab-size.js
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
if (window.location.origin !== 'https://github.com') return;
const tabSizeInput = window.prompt("Write indent size", '4');
if (/^\d+$/.test(tabSizeInput)) {
const newUrl = new URL(window.location.href);
newUrl.searchParams.set('ts', tabSizeInput);
@iamandrewluca
iamandrewluca / bookmarklets.md
Last active Sep 19, 2020
Collection of bookmarklets that I use day to day #bookmarklets
View bookmarklets.md

Any other ideas are welcome. Just ask if what you want is possible. Starter template

  • [Generate a password in browser][1]
  • [Toggle password inputs to text back and forth][2]
  • [Request picture in picture on first found video that is playing][3]
  • [Open any URL with host as localhost:3000][4]
  • [Random table flip text emoji][5]
  • [Random Shrug text emoji][6]
  • [Will speak any select text from page][7]
  • [Outline headings out of order in a page][8]
@iamandrewluca
iamandrewluca / template.js
Created Sep 19, 2020
Template bookmarklet #bookmarklet
View template.js
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
/* code goes here */
})());
@iamandrewluca
iamandrewluca / MyModel.php
Last active Aug 14, 2020
typo3 extbase categories
View MyModel.php
<?php
/**
* categories
*
* \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\Category>
* @lazy
*/
protected $categories;
/**
* MyModel constructor.
@iamandrewluca
iamandrewluca / Accordion.jsx
Last active Aug 10, 2020
Reactstrap Uncontrolled Accordion
View Accordion.jsx
import React from 'react'
import { Card, CardBody, CardHeader, Collapse, Button } from 'reactstrap'
import PropTypes from 'prop-types'
export class Accordion extends React.Component {
state = {
open: this.props.open,
}
toggleSection = (index) => () => {
View remove-liked-videos.js
const sleep = time => new Promise(resolve => setTimeout(resolve, time))
let items = []
const interval = setInterval(async function() {
if (items.length < 10) {
items = Array.from(document.querySelectorAll('#contents ytd-playlist-video-renderer:not([is-dismissed])'))
}
if (items.length === 0) {
clearInterval(interval)
return
}
View tailwindcss-service.js
const postcss = require("postcss");
const tailwind = require("tailwindcss");
const express = require("express");
const app = express();
app.get("/:configBase64/tailwind.css", async (req, res) => {
const buffer = Buffer.from(req.params.configBase64, "base64");
const config = JSON.parse(buffer.toString("utf-8"));
const baseCSS = `@tailwind base;@tailwind components;@tailwind utilities;`;
@iamandrewluca
iamandrewluca / table-flip.js
Last active Jul 27, 2020
Random table flip text emoji #bookmarklet
View table-flip.js
javascript: void(function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
const all = [
"(╯°□°)╯︵ ┻━┻",
"(┛◉Д◉)┛彡┻━┻",
"(ノ≧∇≦)ノ ミ ┸━┸",
"(ノಠ益ಠ)ノ彡┻━┻",
"(╯ರ ~ ರ)╯︵ ┻━┻",
"(┛ಸ_ಸ)┛彡┻━┻",
"(ノ´・ω・)ノ ミ ┸━┸",
@iamandrewluca
iamandrewluca / edit-website.js
Created Jun 29, 2020
Enable page editing #bookmarklet
View edit-website.js
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
document.body.contentEditable = 'true';
document.designMode='on';
})());
You can’t perform that action at this time.