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 / 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 / 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();
@cliffordfajardo
cliffordfajardo / deep-work-quotes.md
Last active October 29, 2024 22:20
Quotes from Cal Newport's Deep Work book

Deep Work Quotes

Deep Work Video


Introductory Quotes into the Topic of Deep Work:

  • “Deep Work: Professional activities performed in a state of distraction-free concentration that push your cognitive capabilities to their limit. These efforts create new value, improve your skill, and are hard to replicate.” (3)

    • Deep work is necessary to wring every last drop of value out of your current intellectual capacity. We now know from decades of research in both psychology and neuroscience that the state of mental strain that accompanies deep work is also necessary to improve your abilities.” (3)
  • “Shallow Work: Noncognitively demanding, logistical-style tasks, often performed while distracted. These efforts tend to not create much new value in the world and are easy to replicate.” (6)

@pH-7
pH-7 / reset-admin-panel-IP-restriction.sql
Last active February 25, 2019 06:41
Reset the pH7CMS, admin panel's IP restriction. Sometimes, your public IP changed, or your website is hosted on a localhost, and you cannot log in anymore to your admin panel. By executing this query through your phpMyAdmin or MySQL command line, you will clear the IP you previously set, and you will again be able to log in to your admin dashboa…
--
-- Author: Pierre-Henry Soria <[email protected]>
-- Website: https://ph7cms.com
-- Copyright: (c) 2011-2019, Pierre-Henry Soria. All Rights Reserved.
-- License: GNU General Public License
--
---
-- Reset the pH7CMS, admin panel's IP restriction.
-- Sometimes, you cannot log in anymore to your admin panel, because your public IP changed, or your website is hosted on a localhost and cannot work with.