Skip to content

Instantly share code, notes, and snippets.

View Akasurde's full-sized avatar
🌏
To the infinity and beyond

Abhijeet Kasurde Akasurde

🌏
To the infinity and beyond
View GitHub Profile
@Akasurde
Akasurde / vscode-macos-context-menu.md
Created March 4, 2025 19:17 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@Akasurde
Akasurde / event_source_kafka.log
Created August 6, 2024 17:37
event_source_kafka.log
# pytest tests/integration/event_source_kafka/ -vvv -s
================================== test session starts ==================================
platform linux -- Python 3.9.18, pytest-8.3.2, pluggy-1.5.0 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/event-driven-ansible
configfile: pyproject.toml
plugins: timeout-2.3.1, asyncio-0.23.8
asyncio: mode=strict
collected 5 items
diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py
index d14832f58e..8cbbe5552a 100755
--- a/lib/ansible/cli/doc.py
+++ b/lib/ansible/cli/doc.py
@@ -815,7 +815,7 @@ class DocCLI(CLI, RoleMixin):
else:
plugin_names = self._list_plugins(ptype, None)
docs['all'][ptype] = self._get_plugins_docs(ptype, plugin_names, fail_ok=(ptype in ('test', 'filter')), fail_on_errors=no_fail)
- # reset list after each type to avoid polution
+ # reset list after each type to avoid pollution
import pymssql
login_user = '' # Replace username
login_password = '' # Replace with password
login_querystring = '' # Replace this with host:port
db = '' # Replace database
conn = pymssql.connect(
user=login_user,
password=login_password,
import asyncio
from typing import Optional, Dict, Any
class AsyncFile:
def __init__(self, file_path: str, mode: str = "r", **kwargs: Optional[Dict[str, Any]]):
self.file_path = file_path
self.mode = mode
self.kwargs = kwargs
self.file = None
from api_helper import ShoonyaApiPy, get_time
import logging
import yaml
import pandas as pd
import pyotp
import asyncio
import json
import websockets
[
{
"children": [
{
"children": [
{
"children": [
{
"children": [],
"event": "runner_on_start",
#!/bin/sh
rfolder=/mnt/sdcard/DCIM/Camera
adb shell ls "${rfolder}" > android.files
lfolder=/Volumes/data/documents/personal/camera
ls -1 "${lfolder}" > local.files
- name: Remove nth element from the list by value
debug:
msg: |
{% set _ = my_list.remove(value) %}
{{ my_list }}
vars:
my_list: [1, 2, 3, 4, 5, 6]
value: 2
- name: Remove nth element from the list by value using reject
debug:
msg: "{{ my_list | reject('search', value)}}"
vars:
my_list: [1, 2, 3, 4, 5, 6]
value: '2'