This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
import subprocess | |
import re | |
FORMAT_COMMANDS = { | |
"C": ["clang-format", "-style=llvm"], | |
"C++": ["clang-format", "-style=llvm"], | |
"Python": ["yapf"], | |
"Lua": ["lua-format"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can make ultra-mini WebView2 scenes with this, so there's no excuse not to start making WebGPU things anymore. | |
#define UNICODE | |
#define _UNICODE | |
#include <windows.h> | |
#include <WebView2.h> | |
ICoreWebView2Environment* g_env = NULL; | |
ICoreWebView2Controller* g_controller = NULL; | |
ICoreWebView2* g_webview = NULL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime | |
import sublime_plugin | |
class ValueSortCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
sel = self.view.sel()[0] | |
sel = sublime.Region(0, self.view.size()) if sel.empty() else self.view.line(sel.begin()).cover(self.view.line(sel.end())) | |
lines = self.view.substr(sel).splitlines() | |
lines.sort() # Alphabetical sort first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to Use: | |
# 1. Set the environment variable 'SERPER_API_KEY' with your API key. | |
# - On Linux/macOS (bash/zsh): Run 'export SERPER_API_KEY="your_api_key_here"' in the terminal. | |
# - On Windows (Command Prompt): Run 'set SERPER_API_KEY=your_api_key_here' in the command prompt. | |
# 2. Run the Python script. | |
# 3. The script will search Google using the provided query and try to find a LinkedIn profile. | |
# - Example query: "doughboys donuts reno owner" | |
# 4. If a LinkedIn profile is found, it will print the URL. If no profile is found, it will print "No LinkedIn profile found." | |
import requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import subprocess | |
import os | |
import socket | |
import sys | |
from urllib.parse import urlparse | |
# Ensure a proxy URL is provided as a command-line argument | |
if len(sys.argv) < 2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
temp=`mktemp` | |
cat > $temp | |
type=`file --mime-type --brief $temp` | |
echo -n "data:$type;base64,`cat $temp | base64 --wrap=0`" | |
rm $temp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bashrc_path="$HOME/.bashrc" | |
grep ^alias /home/$USER/.bashrc | while IFS= read -r line; do | |
# Extract alias name and value | |
alias_name=$(echo "$line" | cut -d '=' -f 1 | cut -d ' ' -f 2) | |
alias_value=$(echo "$line" | cut -d '=' -f 2- | sed "s/'//g") | |
echo -n "/bin/${alias_value%#*}\$@ #${alias_value#*#}" > /home/$USER/.local/bin/$alias_name | |
chmod +x /home/$USER/.local/bin/$alias_name | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if FFmpeg is installed | |
if ! command -v ffmpeg &> /dev/null; then | |
echo "FFmpeg is not installed. Please install FFmpeg and try again." | |
exit 1 | |
fi | |
# Check if a filename is provided as an argument | |
if [ $# -ne 1 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To load the OpenGL functions using the generated glLoadExtensions() function, you need to follow these steps after creating an OpenGL context in a Windows environment: | |
# 1. Create an OpenGL context using a windowing system such as Win32 or GLFW. | |
# 2. Make the OpenGL context current. | |
# 3. Load the OpenGL functions by calling glLoadExtensions(). | |
# List of OpenGL function names | |
fnames = [ | |
"glUseProgram", | |
"glCreateShader", | |
"glShaderSource", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int FB[W*H]; | |
static int OX; | |
static int OY; | |
static int DX; | |
static int DY; | |
static int R; | |
static int G; |
NewerOlder