Skip to content

Instantly share code, notes, and snippets.

View chapmanjacobd's full-sized avatar
🥅
goal_net

Jacob Chapman chapmanjacobd

🥅
goal_net
View GitHub Profile
@gullyn
gullyn / flappy.html
Last active January 24, 2025 00:41
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@fdietze
fdietze / trans-cached.sh
Last active February 6, 2024 02:06
Cache `trans` translation results in sqlite
#!/usr/bin/env bash
set -Eeuo pipefail # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/#:~:text=set%20%2Du,is%20often%20highly%20desirable%20behavior.
shopt -s expand_aliases
SOURCE_LANG=$1
TARGET_LANG=$2
TEXT=$3
ENGINE=${4-google}
CACHEFILE="$HOME/.cache/trans_cache.sqlite"
@santrancisco
santrancisco / record.sh
Last active August 19, 2022 21:27
A simple script to take screenshot and archive it.
#!/bin/bash
# Requirement:
# Linux: xdotool + convert(imagemagik) + flameshot
# Mac: xdotool + imagemagick
# Print out each commands and bail if there is an error
set -ex
CODELOC=$HOME/.sanscreenie
SCRLOC="$CODELOC/screenshots"
@kcubeterm
kcubeterm / Google-sdk-termux.md
Last active February 24, 2025 17:45
How to install google cloud sdk in termux and run cloud shell interactively.

Now Google cloud sdk support python3.9 as well. Lets start.

Without any surprise,use your copy-paste skills to fire following script into your innocent terminal.

pkg install python3 openssh
curl -o sdk.sh sdk.cloud.google.com
chmod +x sdk.sh
./sdk.sh --install-dir=$PREFIX
@ClickerMonkey
ClickerMonkey / types.ts
Last active August 8, 2024 00:25
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@timelyportfolio
timelyportfolio / example.R
Created September 16, 2020 20:38
d3 calendar in R from observable/robservable
# remotes::install_github("juba/robservable")
library(robservable)
# see entire notebook
robservable("@timelyportfolio/a-github-inspired-calendar")
# only see the chart
robservable(
"@timelyportfolio/a-github-inspired-calendar",
@nainemom
nainemom / subtranslate.lua
Last active April 26, 2024 04:03
MPV script to translate current line of subtitle
-- Simple mpv script to translate subtitle using crow (online) or sdcv (offline) dictionaries.
-- INSTALLATION:
-- To install it, first install crow (https://crow-translate.github.io) and/or sdcv (http://dushistov.github.io/sdcv/) on your marchine with your favorite dicts and then,
-- copy this file to '~/.config/mpv/scripts/' (Linux) or '%AppData%\mpv\scripts\' (Windows).
-- sdcv help:
-- you can download offline dicts from http://download.huzheng.org/Quick/ (or anywhere else) and copy extracted dic folder to '~/.stardict/dic/'
-- CONFIGURATION:
local config = {
On Popper’s view, the growth of knowledge begins with a problem, which is usually an inconsistency discovered either within an inherited theory, or between inherited theories, or between an inherited theory and an accepted observation statement. We attempt to solve the problem by proposing new explanatory theories.
We criticise these theories in various ways and we evaluate them as better or worse solutions to our problem. As a result, we usually come to understand the problem better, which leads us to suggest further new theories, which are in turn criticised and evaluated. It may be that we eventually settle on one theory as clearly better than its available rivals (as happened in the case of Newton’s theory in the eighteenth century). That dominant theory may then become a main focus for our criticism, identification of new problems and further development of theory. The attempt to resolve the problems that the criticism of the dominant theory generates may lead to new conjectures which are rivals to that
@myobie
myobie / ci.yml
Last active January 8, 2025 15:35
Don't run GitHub Actions for pull requests that are drafts
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
/**
* BASE SIZE
* All calculations are based on this. It’s recommended that
* you keep it at 1rem because that is the root font size. You
* can set it to whatever you like and whatever unit you like.
*/
$gorko-base-size: 1rem;
/**
* SIZE SCALE