As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Shell script to add docker-ce to Deepin Linux repositories | |
# Remove old docker | |
sudo apt-get remove -y docker docker-engine docker.io containerd runc | |
# Install dependencies | |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Chat with GPT-3 from the Terminal.""" | |
import os | |
import openai | |
if os.path.exists(os.path.expanduser("~/.openai")): | |
openai.api_key = open(os.path.expanduser("~/.openai")).read().strip() | |
else: | |
print("Enter your OpenAI API key: ", end="") | |
openai.api_key = input() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This file goes in .git/hooks/commit-msg | |
set -e | |
git_diff=$(cat "$1") | |
prompt="I want you to help me write a commit message. When I send the output of git diff, I want you to send only a suggested git commit message (only the message, no commands, nothing else), and do not send any explanation or anything else with it. Here is the git diff:\n${git_diff}" | |
(echo "$prompt") | openai complete - >> "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PhpObf { | |
private array $names = array(); | |
private string $nono = "\x1b[H\x1b[2J\x1b[3J"; | |
private string $enctype = ''; |