This file contains 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
| |
trait Optional<T>: Into<Option<T>> {} | |
impl<T> Optional<T> for T where T: Into<Option<T>> {} | |
impl<T> Optional<T> for Option<T> {} | |
fn test<T: Optional<bool>>(test_type: T) -> bool { | |
let test_type = match test_type.into() { | |
Some(test) => test, |
This file contains 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
import os | |
# Set the target directory | |
target_directory = os.path.expanduser('~/documents/screenshots') | |
# Loop through all files in the target directory | |
for filename in os.listdir(target_directory): | |
# Check if the file ends with the extensions we want to delete | |
if filename.endswith('.png') or filename.endswith('.jpg') or filename.endswith('.jpeg'): | |
# Construct full file path |
This file contains 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
cmake | |
bun | |
gh | |
gradle | |
jenv | |
neovide | |
neovim | |
raycast | |
spicetify-cli | |
tmux |
This file contains 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
import os | |
import subprocess | |
def is_git_repo(path): | |
return os.path.exists(os.path.join(path, '.git')) | |
def backup_and_push(path): | |
if is_git_repo(path): | |
print(f"Backing up {path}...") | |
subprocess.run(['git', '-C', path, 'add', '.']) |
This file contains 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
import { text, integer } from "drizzle-orm/sqlite-core"; | |
import { sqliteTable } from "drizzle-orm/sqlite-core"; | |
import { drizzle } from "drizzle-orm/bun-sqlite"; | |
import { Database } from "bun:sqlite"; | |
export const user = sqliteTable('user', { | |
id: integer('userId').primaryKey(), | |
username: text('username').notNull(), | |
}) |