This file contains 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
/* | |
Snippet to auto-check the checkboxes of Github notifications about Pull Request that have been merged | |
Paste this in your console | |
*/ | |
Array.from(document.querySelectorAll('li.notifications-list-item')) | |
.filter(li => li.querySelector('.octicon-git-merge.color-fg-done')) | |
.forEach(li => li.querySelector('label > input[type=checkbox]:not(:checked)').click()); |
This file contains 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
import * as React from "react"; | |
declare global { | |
namespace JSX { | |
interface IntrinsicElements { | |
"amp-3d-gltf": React.DetailedHTMLProps< | |
{ | |
alpha?: "false" | "true"; | |
antialiasing?: "false" | "true"; | |
autorotate?: "false" | "true"; |
This file contains 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
import {jsx} from "slate-hyperscript"; | |
import {JSDOM} from "jsdom"; | |
const DOMParser = new JSDOM().window.DOMParser | |
const htmlToAST = (html: string) => { | |
const parsed = new DOMParser().parseFromString(html, 'text/html') | |
return deserialize(parsed.body) | |
} |
This file contains 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
// yarn add posthtml-parser | |
import parser from 'posthtml-parser' | |
// Paste your HTML component here | |
const html = ` | |
<Box | |
fontSize="12px" | |
lineHeight="16px" | |
textAlign="right" | |
/> |
This file contains 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
ffmpeg -i input.mov -vf mpdecimate,setpts=N/FRAME_RATE/TB output.mov |
This file contains 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
import React, { ReactElement, ReactNode, useState } from 'react' | |
export interface IFlagContext { | |
userEmail: string | null | |
sendEmail: boolean | |
changeUserEmail: (email: string) => void | |
} | |
const FlagContext = React.createContext<IFlagContext | null>(null) |
This file contains 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
require('dotenv').load(); | |
const db = require('../lib/db'); | |
const fetchFacebookLikes = require('../lib/fetch-facebook-likes'); | |
const facebook = { | |
updateLikes: async () => { | |
console.log('Fetching Facebook likes'); |
This file contains 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
require('dotenv').load(); | |
const db = require('../lib/db'); | |
const md5 = require('../lib/md5'); | |
const fetchAmazonSearchResults = require('../lib/fetch-amazon-search-results'); | |
const amazon = { | |
updateSearchResults: async query => { |
This file contains 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 scrapeIt = require('scrape-it'); | |
const fetchAmazonSearchResults = async query => { | |
const {data} = await scrapeIt(process.env.AMAZON_SEARCH_URL + query, { | |
results: { | |
listItem: '.s-result-item', | |
data: { | |
image: { | |
selector: '.s-image', |
This file contains 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 FB = require('fb'); | |
FB.setAccessToken(process.env.FB_ACCESS_TOKEN); | |
async function fetchNextLikes(after) { | |
const url = 'me/likes?limit=100' + (after ? '&after=' + after : ''); | |
const response = await FB.api(url); | |
return [ | |
response.data.map(like => like.name), | |
response.paging && response.paging.cursors.after |
NewerOlder