Skip to content

Instantly share code, notes, and snippets.

View pH-7's full-sized avatar
:octocat:
πŸ’‘Creative Engineer πŸš€ Enjoying Learning New Exciting Things! πŸ˜‹ =>My Way of Life 🏝

β™š PH⑦ de Soriaβ„’β™› pH-7

:octocat:
πŸ’‘Creative Engineer πŸš€ Enjoying Learning New Exciting Things! πŸ˜‹ =>My Way of Life 🏝
View GitHub Profile
@pH-7
pH-7 / ai-video.ts
Created July 1, 2024 12:15
Generate AI videos from a given image using Neon DB, Pinecone, and Replicate
import { Client } from 'pg';
import { PineconeClient } from '@pinecone-database/pinecone';
import Replicate from 'replicate';
// Initialize clients
const neonClient = new Client({
connectionString: 'your_neon_connection_string'
});
const pinecone = new PineconeClient();
@pH-7
pH-7 / fonts-coding-vs-code.md
Last active June 10, 2024 04:28
My favorite fonts for convenient coding on VS Code

Best fonts for your IDE

  1. Space Mono (my favorite one)
  2. Fira Code (my second favorite one πŸ˜„)
  3. MonoLisa
  4. Inconsolata
  5. Apercu Mono
  6. Input Mono
  7. Gintronic
@mxstbr
mxstbr / sync-text-replacements.tsx
Created April 17, 2024 17:56
Raycast snippets > iOS/MacOS text replacements sync Raycast command
import { useEffect } from "react";
import { Detail, open } from "@raycast/api";
import { useExec } from "@raycast/utils";
import Papa from "papaparse";
type Row = {
// "On my way!"
ZPHRASE: string;
// omw
ZSHORTCUT: string;
@pH-7
pH-7 / get-mac-finder-preferences.md
Last active April 25, 2024 17:23
Copy Mac Finder preferences to another Mac

Apple's iCloud isn't able to sync the Finder preferences. However, you can copy/paste the following two plist files to your new Mac.

Copy the following two files to your other Mac computer

~/Library/Preferences/com.apple.dock.plist
~/Library/Preferences/com.apple.finder.plist
@pH-7
pH-7 / show-last-tags.sh
Last active May 1, 2024 00:37
Show the last three git tags (very handy) - https://github.com/pH-7
git tag --sort=-creatordate | head -n3
@pH-7
pH-7 / library-versus-require-in-R.md
Last active May 8, 2025 14:25
Which one is best to use when loading a library in R? - "library()" VS "require()" function in R

library VS require in R

When loading a library, always use library. Never use require

TL;DR: require breaks one of the fundamental rules of robust software systems, fail early.

In a nutshell, this is because, when using require, your code might yield different, erroneous results without signalling an error. This is rare, but not hypothetical! Note that require returns the boolean TRUE if the package is successfully loaded, and FALSE if it is not.

On the other hand, require does install the package if it hasn’t been installed (whereas library doesn’t).

@pH-7
pH-7 / fix-no-matches-found-zsh.sh
Created August 12, 2023 04:52
Run the following in your terminal to fix the unescaped arguments with matching arguments with Z shell. This will fix errors such as "zsh: no matches found: head^" error
echo "\n# Allow unmatched wildcard expressions in zsh\nsetopt NO_NOMATCH" >> ~/.zshrc
@pH-7
pH-7 / install-ruby-rails-macos.md
Last active August 12, 2023 09:41
How to install Ruby 3 with Rails v7, on macOS?

How to install Ruby & Rails on macOS?

Here are the simple 4 steps to install Ruby 3 and Rails v7 on macOS

Step 1: Install Homebrew

First, open your Terminal and run the following steps (I personally use iTerm2).

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@pH-7
pH-7 / DataFrameSample.R
Last active May 8, 2025 14:15
Data Frames, object structure in R
# create a data frame
user_df <- data.frame(
name = c("Alice", "Bob", "Charlie", "Dave"),
age = c(25, 32, 47, 19),
city = c("New York", "San Francisco", "Los Angeles", "Chicago"),
stringsAsFactors = FALSE
)
# view the data frame
user_df
@pH-7
pH-7 / caps-naming-convention-programming.md
Last active May 23, 2023 11:24
Naming Convention - Programming

Caps, programming

  • UpperCamel case for classes. e.g., MyClass {}
  • lowerCamel case for variable names. e.g., myVar = "";
  • snake_case for Python functions and other functions delimited with underscores _ e.g., my_function();