Skip to content

Instantly share code, notes, and snippets.

View sepbot's full-sized avatar
👞
shoehorning code

sepbot

👞
shoehorning code
View GitHub Profile
{
"chromeMetadata": {
"OS": "macOS Version 15.3.2 (Build 24D81)",
"application": "Google Chrome",
"revision": "b623489a994ecb8df7381fcceb54cfd3aafc9c3c-refs/branch-heads/6998@{#1899}",
"version": "134.0.6998.89 (Official Build) (arm64)"
},
"policyValues": {
"chrome": {
"name": "Chrome Policies",
@sepbot
sepbot / gist:38ab22b14c0155e1f2e407c506320c5d
Created March 13, 2025 22:35
Command-line variations
--force-fieldtrials="*ALPSNewCodepoint/EnabledLaunch/*AdsP4/Default/AiPrivacyFrameworkPhase1/Launch/*AnnotatedPageContentExtraction/Default/*AudioInputConfirmReadsViaShmem/Control/*AutofillAddressSuggestionsOnTyping/Default/*AutofillBetterLocalHeuristicPlaceholderSupport/Default/AutofillDisableLocalCardMigration/EnabledLaunch/AutofillEnableAccountStorageForIneligibleCountries/Default/*AutofillEnableCvcStorage/Launched_98/AutofillEnableVcnGrayOutForMerchantOptOut/EnabledLaunch/*AutofillFixValueSemantics/Control_20250225/*AutofillGreekRegexes/Default/*AutofillI18nFRAddressModel/Default/*AutofillI18nNLAddressModel/Default/AutofillImprovedLabels/Default/*AutofillIncludeUrlInCrowdsourcing/EnabledLaunch/AutofillInferLabelFromDefaultSelectText/Default/AutofillParseEmailLabelAndPlaceholder/Default/*AutofillSupportPhoneticNameForJP/Default/AutofillUnmaskCardRequestTimeout/Default/*AutofillVoteWhenInactive/Default/*BackForwardCacheForPageWithCacheControlNotStoredHeader/EnabledLaunch/*BackgroundTabLoadingFromPerformance
@sepbot
sepbot / roomy.zsh-theme
Created October 30, 2023 23:56
roomy zsh prompt
PROMPT=$'\n'
PROMPT+=' %{$fg[yellow]%}%n@%m%{$reset_color%}'
PROMPT+=' %{$fg[cyan]%}%~%{$reset_color%} $(git_prompt_info)'
PROMPT+=$'\n'" "
PROMPT+="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT+="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
val ctx = Context.newBuilder()
.allowAllAccess(true)
.build()
@Language("Python") val script = """
import polyglot
@polyglot.export_value
def main(x):
return x + 1
""".trimIndent()
use std::{env, io::Error as IoError, net::SocketAddr};
use futures_util::StreamExt;
use tokio::net::{TcpListener, TcpStream};
use tokio_tungstenite::accept_async;
use tungstenite::Error;
async fn handle_connection(raw_stream: TcpStream, addr: SocketAddr) -> tungstenite::Result<()> {
defmodule Test do
# runs command and logs outputs when they become available, mostly useful for long running commands that
# provide incremental output as the command progresses
def run_command_and_log!(host, conn, command) do
res = Enum.reduce(
SSHEx.stream(conn, command, channel_timeout: 10_000, exec_timeout: 3_600_000),
%{:status => nil,:stdout => [], :stderr => []},
fn (x, acc) ->
case x do
{:stdout, row} ->
@sepbot
sepbot / touch.ts
Created February 4, 2020 21:07
somehow implementing these touch event handlers from scratch yielded less code than using something like hammer.js
import { XY } from './types';
export const setupTouch = (
container: HTMLElement,
animate: () => void,
tapped: (position: XY) => void,
panned: (delta: XY) => void,
pinched: (delta: number) => void,
) => {
const ctx = {
@sepbot
sepbot / poly.py
Created October 21, 2019 05:12
sklearn Polynomial Regression
class PolynomialRegression(BaseEstimator):
def __init__(self, degree=2):
self.features = PolynomialFeatures(degree=degree)
self.model = LinearRegression()
def get_params(self, deep=True):
return {'degree': self.features.degree}
def set_params(self, **params):