Skip to content

Instantly share code, notes, and snippets.

Avatar
👮
Git inspector!

Andrew Luca iamandrewluca

👮
Git inspector!
View GitHub Profile
View routes.ts
const routerPagesNames = {
forgotpassword: 'forgotpassword',
login: 'login',
resetPassword: 'reset-password',
index: {
index: 'index',
communication: 'index-communication',
content: 'index-content',
statistics: 'index-statistics',
users: 'index-users',
@iamandrewluca
iamandrewluca / CODE_FOR_MOLDOVA_CLA
Created Apr 30, 2021
CODE FOR MOLDOVA Individual Contributor License Agreement
View CODE_FOR_MOLDOVA_CLA
### CODE FOR MOLDOVA Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by CODE FOR MOLDOVA SE or its affiliates (“CODE FOR MOLDOVA”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to CODE FOR MOLDOVA in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact contact@code4.md.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to CO
@iamandrewluca
iamandrewluca / bookmarks-to-notion.js
Last active Feb 23, 2021
Export browser bookmarks, import them in Notion as a database
View bookmarks-to-notion.js
(function bookmarksExportToCsv() {
/**
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks
*/
@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 / 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 */
})());
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}
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 / find-duplicated-ids.js
Created Jun 29, 2020
Will search and mark duplicated IDs on a page #bookmarklet
View find-duplicated-ids.js
javascript: void ((function() {
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */
document.querySelectorAll('[id]').forEach(el => {
const specificIds = document.querySelectorAll(`[id="${el.id}"]`);
if (specificIds.length > 1 && specificIds[0] === el) {
console.log('Duplicate id ' + el.id);
specificIds.forEach(element => {
element.style.outline = '5px solid red';
});
alert('duplicate found');
@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';
})());