Skip to content

Instantly share code, notes, and snippets.

View kolaente's full-sized avatar
:shipit:
The problem with git jokes is everyone has their own version.

kolaente

:shipit:
The problem with git jokes is everyone has their own version.
View GitHub Profile
@jeremybenaim
jeremybenaim / changelog_generator.yml
Last active January 28, 2024 19:13
Automate your changelog thanks to ChatGPT
# .github/workflows/changelog_generator.yml
name: Generate Changelog and Post to Slack
on:
schedule:
# This will run every Friday at 3 PM UTC
- cron: "0 15 * * 5"
jobs:
@RobertAKARobin
RobertAKARobin / safari.md
Last active January 5, 2024 05:41
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

What is the temperature outside?

I'm sorry, but I am a large language model trained by OpenAI and don't have access to real-time information about the weather. I am not able to browse the internet or access information about the current temperature outside. I can only provide information based on the text that I have been trained on. Is there something else I can help you with?

Very good! What would a bad response be to that prompt?

A bad response to the prompt "What is the temperature outside?" would be to provide information that is unrelated to the question or to provide an incorrect answer. For example, a bad response would be to say "The temperature outside is 25 degrees" if the actual temperature is much different. Other bad responses could include providing irrelevant information, such as a description of the weather or a forecast for a different location, or providing no response at all. It is important to provide a clear, accurate, and relevant answer to a question in order to provide helpful

@domeniko-gentner
domeniko-gentner / update_gitea.py
Last active February 26, 2022 17:51
Updating gitea automatically
#!/usr/bin/env python3
from requests import get
from requests import exceptions
from subprocess import run
def fetch_newest_gitea():
# change prefix as needed
GITEA_INSTALL = "/usr/local/bin/gitea"
#!/bin/bash
cd_path="/dev/sr0"
out_path="/media/isos/iso"
mkdir -p $out_path
cd_id="$(date +%s | sha256sum | head -c 8 ; echo)"
cd_id="${cd_id^^}"
bs=$(isoinfo -d -i ${cd_path} | grep -i -E 'block size'|awk '{print $NF}' )
@gwleuverink
gwleuverink / progress-bar.blade.php
Last active April 9, 2024 10:31
Progress bar blade component
@props([
'percentage' => 0,
'failed' => false
])
@php
$done = $failed || $percentage == 100;
@endphp
<div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }}
@huysentruitw
huysentruitw / chrome-offline-game.js
Created April 6, 2020 19:38
chrome-offline-game
jump = () => {
const space = { bubbles: true, key: 'Space', keyCode: 32, charCode: 0 };
document.activeElement.dispatchEvent(new window.KeyboardEvent('keydown', space));
document.activeElement.dispatchEvent(new window.KeyboardEvent('keyup', space));
};
ctx = document.getElementsByClassName('runner-canvas')[0].getContext('2d');
detect = () => {
const data = ctx.getImageData(105, 125, 1, 1).data;

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@rjhansen
rjhansen / keyservers.md
Last active April 14, 2024 12:28
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

require 'rubygems'
require 'json'
require 'net/http'
require 'time'
$old_id = 0
$total_length = 0
$rant_count = 0
def restore_data