Skip to content

Instantly share code, notes, and snippets.

#uses venv and autoenv
#install them first!
#venv: https://docs.python.org/3/library/venv.html
#autoenv: https://github.com/hyperupcall/autoenv
#autoenv authorized envs are located in ~/.local/state/autoenv/authorized_list
function newpyenv() {
local DIR=$PWD
if [ $# -ne 0 ]; then
DIR="${PWD}/$1"
fi

Controller for golang http app: userresource

2023-09-07 20:29:25

User

I am writing a Write a controller for a golang http app, the controller is for Users. The model/data handling for the users has the following functions

func NewUserService(db *sql.DB) *UserService {

#!/usr/bin/env zsh
# Alias a 'cd' to all your ~/project directories on the command line with @<projectname>
# just type: @my_cool_project -- to 'cd' to '~/projects/my_cool_project'
# to install just add `source alias_projects.zsh` to your ~/.zshrc
PROJECTS_DIR=$HOME/projects
for dir in $(
ls -lta $PROJECTS_DIR |
grep ^d |

Ephemeral dance: time's fleeting symphony

2023-10-29 00:30:40

User

give me a haiku about the temporary nature of time

Assistant

Sunrise to sunset,

Qualitative Measurement List:

Users will score satisfaction on a 1-5 scale following performance of the designated tasks. 1 being strongly disagree, 5 being strongly agree.

  • Usability Score (1-5)
    • The app displays photos efficiently
      • 5
    • The app displays videos efficiently
      • 5
  • The app is easy to read

User

give me a js code example of a hello world express app

Assistant

Here is a very simple example of a "Hello, World!" app written in Node.js using Express.js.

const express = require('express')
const app = express()

User

How many calories are burned by the human brain investingating a grid of images for 5 seconds

Assistant

The human brain burns roughly 20% of a person's daily caloric intake, approximately 300-500 calories during a full day, assuming a 2,000 calorie diet. However, calculating the precise number of calories burned in 5 seconds during a specific activity like investigating a grid of images is not straightforward.

Calories burned is not usually measured by the specific task the brain is doing, since the brain is always on and burning calories; whether you're thinking hard or not really doesn't change its consumption much. According to various sources, the brain uses approximately 0.25 calories per minute at rest.

For a 5 second period the calculation would be approximately:

User

How many calories are burned by the human brain investingating a grid of images for 5 seconds

Assistant

The human brain burns roughly 20% of a person's daily caloric intake, approximately 300-500 calories during a full day, assuming a 2,000 calorie diet. However, calculating the precise number of calories burned in 5 seconds during a specific activity like investigating a grid of images is not straightforward.

Calories burned is not usually measured by the specific task the brain is doing, since the brain is always on and burning calories; whether you're thinking hard or not really doesn't change its consumption much. According to various sources, the brain uses approximately 0.25 calories per minute at rest.

For a 5 second period the calculation would be approximately:

A Siri shortcut to download youtube.com copied in the clipboard (via yt-dlp)

First: 👉 Install yt-dlp

Second: 👂 A conversation...

User

I want to make a siri shortcut for macos which runs a terminal command in ~/Desktop with the argument which is in the clip board

Troubleshooting playback of .mov files from quicktime on iphone

2024-03-07 01:43:24

User

why cant i play .mov files from macos quicktime in iphone?

Assistant

If you're having trouble playing .MOV files from macOS QuickTime on your iPhone, it could be due to several reasons. Here are some common issues and suggestions for resolving them: