Skip to content

Instantly share code, notes, and snippets.

@MuhammetOzturk
MuhammetOzturk / VimScriptForPythonDevelopers.MD
Created September 10, 2024 21:55 — forked from yegappan/VimScriptForPythonDevelopers.MD
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

@MuhammetOzturk
MuhammetOzturk / fdisk-subprocess.py
Created April 29, 2024 22:39
fdisk komutunu python ile kullanma
from subprocess import Popen,PIPE
fdiskl = "fdisk -l /home/muhammet/DietPi_RPi-ARMv8-Bookworm.img"
#fdisk -l 8. satirdan itaberen bolum bilgilerini verir.
device_info = Popen(fdiskl , stdout = PIPE, text = True, shell = True).stdout.read().splitlines()[8:]
#Sadece sektor bilgilerini elde ettikten sonra veriyi liste tipinde stringe cevir
@MuhammetOzturk
MuhammetOzturk / arduino.snippets
Created March 27, 2023 21:28
FreeRTOS fonksiyonlari icin hazirladigim snippets ornekleri.
#########################################################################################
# Vim'de ultisnips kullanirken freertos #
# fonksiyonlari icin hazirladigim snippets ornekleri #
# #
# Dokumantasyon: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt #
#########################################################################################
snippet inc "#include " b
#include <$0.h>
endsnippet
@MuhammetOzturk
MuhammetOzturk / Headless raspberry pi.sh
Created December 11, 2022 22:23
Headless Raspberry Pi
#!/bin/bash
IMAGE=$1
BOOT_POINT="/tmp/raspberrypi/boot"
ROOT_POINT="/tmp/raspberrypi/root"
CONNECTION="/etc/NetworkManager/system-connections/*"
mkdir -p $BOOT_POINT
mkdir -p $ROOT_POINT
@MuhammetOzturk
MuhammetOzturk / User Agents.txt
Created December 5, 2022 14:45
Examples of Headers for Scraping Information On the Web
{'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36',
'Accept-Encoding': 'gzip',
'Accept': '*/*',
'Connection': 'keep-alive'}
{'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36',
'Accept-Encoding': 'gzip',
'Accept': '*/*',
'Connection': 'keep-alive'}