This is a script picking winners for a contest where:
- every winning entry has to mention one other twitter account in a reply
- double winners are allowed
You'll need a few things installed:
- jq
- twarc
- boxes
<template> | |
<div class="bg-white"> | |
<div | |
@mouseenter="paused = true" | |
@mouseleave="paused = false" | |
@mouseover="paused = true" | |
@click="continueRotation()" | |
class="cardstack mt-24 xs:mt-28 sm:mt-24 mb-24 m-auto max-w-screen-sm grid grid-cols-1 grid-rows-1 select-none"> | |
<article v-for="card in cards" |
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
### to verify your gpu is cuda enable check |
#!/bin/bash | |
# Loop through all MP4 files in the current directory | |
for file in *.mp4 | |
do | |
# Extract the file name without the .mp4 extension | |
filename=$(basename "$file" .mp4) | |
# Run the ffmpeg command for the current file | |
ffmpeg -i "$file" -filter_complex "scale=960:960:force_original_aspect_ratio=increase,crop=960:960" "${filename}_square.mp4" |
<doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://cdn.tailwindcss.com"></script> | |
</head> | |
<body class="bg-black"> |
This is a script picking winners for a contest where:
You'll need a few things installed:
// using https://try-puppeteer.appspot.com/ | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.setViewport({width: 1500, height: 3000, deviceScaleFactor: 4}); | |
await page.goto('https://twitter.com/arvidkahl/status/1375476092853743621?s=20'); | |
await page.waitForNavigation({ waitUntil: 'networkidle2' }) | |
console.log(await page.content()); | |
await page.screenshot({path: 'screenshot.png'}); |
const stopwords = 'a an and at but by for in nor of on or so the to up yet' | |
const defaults = stopwords.split(' ') | |
function titleCase1(str, options) { | |
const opts = options || {} | |
if (!str) return '' | |
const stop = opts.stopwords || defaults | |
const keep = opts.keepSpaces |
// Make sure to pass the correct currency symbol, three-letter-name and your locale | |
(function(currency='$', currencyName='USD', locale='en-US'){return (Math.ceil(100*Array.prototype.slice.call(document.getElementsByTagName('span')).reduce((acc,item,index,src)=>{if(item.innerText.indexOf(currency)>-1){return acc+parseFloat(item.innerText.replace(/,/g,'.').replace(RegExp(currency, "g"),''))}else{return acc}}, 0.0))/100).toLocaleString(locale,{style: 'currency',currency: currencyName,});})("€", "EUR", "de-DE") |
Vue.component("tree-view-item", Vue.extend({ | |
name: "tree-view-item", | |
props: ["data", "max-depth", "current-depth"], | |
data: function(){ | |
return { | |
open: this.currentDepth < this.maxDepth | |
} | |
}, | |
methods: { | |
isOpen: function(){ |