Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Elijah Manor elijahmanor

😀
View GitHub Profile
@elijahmanor
elijahmanor / ChatGTP.js
Created December 4, 2022 19:01
Chat GTP: Show JavaScript code that will reverse a string and take the first 5 characters and uppercase them
View ChatGTP.js
function reverseString(str) {
// Step 1: Use the split() method to return a new array
let splitString = str.split(""); // split() method splits a string into an array of substrings
// Step 2: Use the reverse() method to reverse the new created array
let reverseArray = splitString.reverse(); // reverse() method reverses an array in place
// Step 3: Use the join() method to join all elements of the array into a string
let joinArray = reverseArray.join(""); // join() method joins all elements of an array into a string
@elijahmanor
elijahmanor / .zshrc
Created August 22, 2022 20:24
ghpr function
View .zshrc
function ghpr() {
GH_FORCE_TTY=100% gh pr list | fzf --query "$1" --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down --header-lines 3 | awk '{print $1}' | xargs gh pr checkout
}
@elijahmanor
elijahmanor / realtime-twitter-banner.json
Created June 5, 2022 17:12
Real-time Twitter Banner Config
View realtime-twitter-banner.json
{
"editor": "source",
"widgets": [
{
"data": {
"type": "user"
},
"type": "background"
},
{
@elijahmanor
elijahmanor / README.md
Last active April 18, 2022 21:45
OCR from macOS Terminal
View README.md

I was reviewing a PR and there was a screenshot of the terminal that had output I wanted in text form.

Terminal Screenshot

So, I installed an OCR tool locally (called tesseract) and converted the PNG into TEXT.

# Install the OCR tool
brew install tesseract tesseract-lang
@elijahmanor
elijahmanor / main.go
Last active February 18, 2022 22:25
Tmux Status Right
View main.go
package main
import (
"fmt"
"strings"
"os/exec"
"strconv"
)
const white = "#f8f8f2"
@elijahmanor
elijahmanor / index.html
Last active January 10, 2022 14:31
Fill JavaScript Array #jsbench #jsperf (http://jsbench.github.io/#2bcdfb2f21a686a56efc07d17e471a85) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fill JavaScript Array #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@elijahmanor
elijahmanor / firebase.js
Created September 24, 2020 12:40
Firebase Code inside a Next.js API Function
View firebase.js
const firebase = require("firebase");
// Required for side-effects
require("firebase/firestore");
const firebaseConfig = { /* ... */ };
try {
firebase.initializeApp(firebaseConfig);
} catch (error) {
/*
@elijahmanor
elijahmanor / index.html
Last active March 12, 2020 16:11
react-playground
View index.html
<div id="app"></div>
@elijahmanor
elijahmanor / agnoster.zsh-theme
Created January 2, 2020 15:23
agnoster.zsh-theme with random emoji
View agnoster.zsh-theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@elijahmanor
elijahmanor / settings.json
Last active November 27, 2019 16:13
settings.json vs code
View settings.json
{
"editor.minimap.enabled": false,
"vim.easymotion": true,
"vim.highlightedyank.enable": true,
"vim.easymotionMarkerFontFamily": "Menlo, Monaco, 'Courier New', monospace",
"vim.easymotionMarkerYOffset": 6,
"vim.easymotionMarkerFontSize": "12",
"window.zoomLevel": 2,
"editor.cursorSmoothCaretAnimation": true,
"editor.smoothScrolling": true,