Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active March 29, 2024 07:03
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"
@martinkozle
martinkozle / celery.py
Last active March 29, 2024 07:02
Celery Pydantic Task PoC
import celery
from tasks import FooTask
app = celery.Celery(
"app",
broker="amqp://",
)
FooTask.register_for_app(app)
@kaan-aytekin
kaan-aytekin / load_juggernaut_xl_inpaint_with_diffusers.py
Last active March 29, 2024 07:02
Load JuggerXL_V7_inpaint_v1 model with 🧨 diffusers
import torch
from diffusers import StableDiffusionXLInpaintPipeline
import tempfile
import requests
from omegaconf import OmegaConf
from io import BytesIO
# MANUALLY ADJUST CONFIG FILE
config_url = "https://raw.githubusercontent.com/Stability-AI/generative-models/main/configs/inference/sd_xl_base.yaml"
original_config_file = BytesIO(requests.get(config_url).content)
"""
31-round sha256 collision.
Not my research, just a PoC script I put together with numbers plugged in from the slide at
https://twitter.com/jedisct1/status/1772647350554464448 from FSE2024
SHA256 impl follows FIPS 180-4
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf
"""
@Alexey-N-Chernyshov
Alexey-N-Chernyshov / client.c
Last active March 29, 2024 06:56
Example of client/server with select().
// Simple example of client.
// Client prints received messages to stdout and sends from stdin.
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/select.h>
#include <netinet/in.h>
@MuhsinFatih
MuhsinFatih / pythondoneright.md
Last active March 29, 2024 06:56
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 06:56
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active March 29, 2024 06:53
Files for PlayStation BIOS Files NA-EU-JP
@c0rp-aubakirov
c0rp-aubakirov / ClientInfo.java
Last active March 29, 2024 06:50
How to get full client info using servlet request, including client IP, browser, os, use-agent and referer
public void printClientInfo(HttpServletRequest request) {
final String referer = getReferer(request);
final String fullURL = getFullURL(request);
final String clientIpAddr = getClientIpAddr(request);
final String clientOS = getClientOS(request);
final String clientBrowser = getClientBrowser(request);
final String userAgent = getUserAgent(request);
logger.info("\n" +
@darkglow88-john
darkglow88-john / index.html
Created March 29, 2024 06:49
Responsive Audio Player
<div class="container">
<div class="column add-bottom">
<div id="mainwrap">
<div id="nowPlay">
<span id="npAction">Paused...</span><span id="npTitle"></span>
</div>
<div id="audiowrap">
<div id="audio0">
<audio id="audio1" preload controls>Your browser does not support HTML5 Audio! 😢</audio>
</div>