Skip to content

Instantly share code, notes, and snippets.

import {assertString} from 'plugins/assert'
type TemplateContext = {
input: string
customPrompt?: string
}
type Template = (context: TemplateContext) => string
type ServerPredictionPrompt = {
@infostreams
infostreams / php.sh
Created November 8, 2021 10:20
Change PHP version on MacOS
#!/bin/bash
available=$(brew list --formula -1 | egrep '^php@|^php$')
syntax () {
echo "SYNTAX: $0 <version>"
echo ""
echo -n "<version> needs to be one of: "
echo $available
echo ""
@dodying
dodying / favicon.md
Last active April 12, 2024 12:47
[Get Favicon] #api #favicon
  • DuckDuckGo https://icons.duckduckgo.com/ip2/{hostname}.ico
  • Google https://www.google.com/s2/favicons?domain_url={hostname}
  • Yandex https://favicon.yandex.net/favicon/{hostname1}/{hostname2}/
  • allesedv https://f1.allesedv.com/16/{hostname}
  • http://grab-favicons.herokuapp.com/api/v1/grab-favicons/?url={hostname}
  • https://besticon-demo.herokuapp.com/icon?url={hostname}&size=80..120..200
  • http://favicongrabber.com/service-api-reference
@richjenks
richjenks / countries.md
Last active April 5, 2024 15:19
ISO 3166 countries by region — AMER, EMEA & APAC
Country ISO 3166 Region
Afghanistan AF EMEA
Åland Islands AX EMEA
Albania AL EMEA
Algeria DZ EMEA
American Samoa AS APAC
Andorra AD EMEA
Angola AO EMEA
Anguilla AI AMER
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@wboykinm
wboykinm / index.html
Last active October 25, 2017 02:46
Mapbox Geolocation by IP
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title></title>
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js'></script>
<script src='http://codeorigin.jquery.com/jquery-1.10.2.min.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.css' rel='stylesheet' />
<!--[if lte IE 8]>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.ie.css' rel='stylesheet'>