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 / Binary-Search.js
Last active August 25, 2024 23:34
Binary Search
function doSearch(array, targetValue) {
var min = 0;
var max = array.length - 1;
var guess;
while (max >= min) {
guess = Math.floor((max + min) / 2 );
if (targetValue === array[guess]) {
return guess;
@pH-7
pH-7 / alfred-workflows.md
Last active August 25, 2024 23:34
My Alfred workflows

My Alfred productivity workflows

@pH-7
pH-7 / udemy-full-discount.py
Last active August 25, 2024 23:30
Get all Udemy Courses with 100% off Coupons thanks to growthcoupon.com & Importer.io
##########
##
## Get all Udemy Courses with 100% off Coupons thanks to growthcoupon.com & Importer.io
##
##########
from json import loads
from bs4 import BeautifulSoup
import mechanize
@pH-7
pH-7 / keybindings.json
Last active August 22, 2024 07:30
Productivity Add Custom VS Code Keybindings. Move Cursor Up/Down by 2 Lines
[
{
"key": "alt+up",
"command": "cursorMove",
"when": "textInputFocus",
"args": {
"to": "up",
"by": "line",
"value": 2
}
@pH-7
pH-7 / .gitconfig
Last active August 20, 2024 07:56
My ~/.gitconfig
[user]
name = Pierre-Henry Soria
email = $EMAIL_ADDRESS
[init]
defaultBranch = main
[color]
diff = auto
status = auto
@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
@pH-7
pH-7 / 6-digit-code.js
Last active June 9, 2024 02:06
Generate a One-Tine Password / One-Time Code unique 6-digit code
// generate a unique 6-digit OTP code
const generateOntTimeCode = () => Math.floor(Math.random() * 900000) + 100000;
@pH-7
pH-7 / PhoneLinkComponent.tsx
Created June 9, 2024 01:58
React Native PhoneLink component. e.g. <PhoneLink phoneNumber="+442011145678" />
import React from 'react';
import { StyleSheet, Text, TouchableOpacity, Linking } from 'react-native';
interface PhoneLinkProps {
phoneNumber: string;
}
export const PhoneLink: React.FC<PhoneLinkProps> = ({ phoneNumber }) => {
const handlePress = () => {
Linking.openURL(`tel:${phoneNumber}`);
@pH-7
pH-7 / .tmux.conf
Created June 3, 2024 12:28
My tmux conf file ~/.config/tmux/tmux.conf
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
run '~/.tmux/plugins/tpm/tpm'
@pH-7
pH-7 / mylocalserverip.sh
Last active June 2, 2024 21:14
Get my server local IP (saver time if you change very often your machine) - https://github.com/HiDeaUp/hideaup.github.io
ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'