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
add_action( 'wp_enqueue_scripts', 'my_custom_script_load' );
function my_custom_script_load(){
wp_enqueue_script( 'my-custom-script', get_stylesheet_directory_uri() . '/custom-scripts', array( 'jquery' ) );
}
@raymelon
raymelon / postman_save_response_to_an_enviroment_variable.js
Last active September 13, 2023 14:41
postman save response to an enviroment variable
// on Tests tab, enter these
var jsonData = pm.response.json();
if (jsonData["response_field_key"])
pm.environment.set("ENV_VARIABLE_KEY", jsonData.access_token);
@raymelon
raymelon / gcloud_disk_from_external_snapshot
Last active September 27, 2019 11:52
Google Cloud Platform create a disk from another project's snapshot
gcloud compute disks create [new disk name] --source-snapshot [use full url of the said snapshot]
adb shell setprop debug.layout true && adb shell service check SurfaceFlinger
git branch -v -a | grep {search string}
#!/bin/bash
int_handler()
{
echo "Interrupted."
# Kill the parent process of the script.
kill $PPID
exit 1
}
trap 'int_handler' INT
@raymelon
raymelon / watchdog_example.py
Created June 21, 2019 05:51 — forked from njanakiev/watchdog_example.py
Simple example of monitoring file system events in Python with the watchdog module
import sys
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import time
class EventHandler(FileSystemEventHandler):
def on_any_event(self, event):
print("EVENT")
print(event.event_type)
print(event.src_path)
{ command } | xclip -selection c
# e.g.
# pwd | xclip -selection c
# from https://stackoverflow.com/a/4208191/4895040
# get port
> sudo lsof -t -i:5000
{PORT}
>
# kill using the port
> sudo kill -9 {PORT}
# recheck (should output nothing)
> sudo lsof -t -i:5000
From https://github.com/fish-shell/fish-shell/issues/527#issuecomment-32237807
set --universal fish_user_paths $fish_user_paths ~/path/name