Skip to content

Instantly share code, notes, and snippets.

View raymelon's full-sized avatar
👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋

Raymel raymelon

👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋
View GitHub Profile
@raymelon
raymelon / windows-update-services-permission-denied-FIX.md
Created July 18, 2024 19:06
windows-update-services-permission-denied-FIX

From https://learn.microsoft.com/en-us/answers/questions/487105/unable-to-set-in-automatic-the-windows-update-at-s

Steps to return wuauserv Registry Permissions to normal:

  1. Activate the default Administrator account (net user administrator /active:yes) and sign in with it
  2. Run Regedit with administrator rights
  3. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv
  4. Right click on wuauserv and go to Permissions
  5. Click on Advanced
  6. Click on "Change" to change the Owner to Administrator and click Apply (SYSTEM is the default owner)
@raymelon
raymelon / google-form-to-tg.gs
Created July 13, 2024 12:51 — forked from HirbodBehnam/google-form-to-tg.gs
A google script to send submitted form results to a telegram bot
// Inspired by https://github.com/Iku/Google-Forms-to-Discord
const BOT_API = "YOUT_BOT_API";
const CHAT_ID = "CHAT_ID";
function onSubmit(e) {
var form = FormApp.getActiveForm();
var allResponses = form.getResponses();
var latestResponse = allResponses[allResponses.length - 1];
var response = latestResponse.getItemResponses();
var result = "";
@raymelon
raymelon / disable_verification_scripts_on_git_commit.bash
Last active January 23, 2024 10:08
disable verification scripts on git commit (like lint-staged and husky)
git commit -m "commit message" --no-verify
# use --no-verify flag
#
# lint-staged: https://github.com/lint-staged/lint-staged
# husky: https://github.com/typicode/husky
#
# example of lint-staged on package.json:
#
# {
@raymelon
raymelon / publickey-git-error.markdown
Created December 16, 2023 14:20 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@raymelon
raymelon / untrack_or_track_a_file_after_adding_to_gitignore_not_delete.sh
Last active November 2, 2023 18:28
Untrack / Track a file after adding to gitignore, not delete
# source: https://superuser.com/a/1655712/454512
#
# to untrack (future versions will not be included on git)
git update-index --assume-unchanged <file>
# to track again (future changes will be included by git again)
git update-index --no-assume-unchanged <file>
# to view untracked files
@raymelon
raymelon / PowerShell - Power Plan Single Switcher
Last active April 1, 2023 07:37
PowerShell - Power Plan Single Switcher
$balanced = "BALANCED-GUID"; $highPerformance = "HIGHPERFORMANCE-GUID"; If ((powercfg /getactivescheme) -like "*" + $balanced + "*") { echo "balanced is active. setting to high performance..."; powercfg /setactive $highPerformance; powercfg /getactivescheme; echo "`nwaiting for 5min before setting back to balanced..."; Wait-Event -SourceIdentifier "ProcessStarted" -Timeout 300; powercfg /setactive $balanced; powercfg /getactivescheme; } ElseIf ((powercfg /getactivescheme) -like "*" + $highPerformance + "*") { echo "high peformance is active. setting to balanced..."; powercfg /setactive $balanced; powercfg /getactivescheme; }
@raymelon
raymelon / barcode-mask-example-3.jsx
Created November 3, 2021 13:16 — forked from shahnawaz/barcode-mask-example-3.jsx
react-native-barcode-mask example usage
import React from "react";
import {
Text,
View,
Item,
Icon,
Input,
Button
} from 'native-base';
import { KeyboardAvoidingView } from "react-native";
@raymelon
raymelon / moment-greetings.js
Created January 2, 2021 07:39 — forked from AllanPooley/moment-greetings.js
Time based user greetings (Good Morning, Afternoon, Evening) using moment.js
getGreetingTime = (currentTime) => {
if (!currentTime || !currentTime.isValid()) { return 'Hello'; }
const splitAfternoon = 12; // 24hr time to split the afternoon
const splitEvening = 17; // 24hr time to split the evening
const currentHour = parseFloat(currentTime.format('HH'));
if (currentHour >= splitAfternoon && currentHour <= splitEvening) {
// Between 12 PM and 5PM
return 'Good afternoon';
@raymelon
raymelon / send_mj_templates.sh
Created December 27, 2020 04:14 — forked from bsartek/send_mj_templates.sh
Send a mailjet template through a shell script using environment variables
#!/bin/bash
: ${MJ_APIKEY_PUBLIC:="YOUR PUBLIC APIKEY HERE"}
: ${MJ_APIKEY_PRIVATE:="YOUR PRIVATE APIKEY HERE"}
: ${TEMPLATE:="291077"}
: ${TO:='foo@bar.com'}
: ${TO_NAME:='Testers'}
: ${FROM:='bar@baz.com'}
: ${FROM_NAME:='Your name'}
: ${SUBJECT:="Email sent by script $0"}