I hereby claim:
- I am sgornick on github.
- I am sgornick (https://keybase.io/sgornick) on keybase.
- I have a public key ASBzLPO33xyBaO07kNG_goZWSMwVGfx1ORsnX04d0IMpBAo
To claim this, I am signing this object:
| Hold a file open exclusively, not even for reading (PowerShell)import os, win32file | |
| while True: | |
| try: | |
| filename_and_path = input("Enter filename and path for the file to hold open exclusively: ") | |
| if not os.path.isabs(filename_and_path): | |
| # If relative path, convert it to an absolute path | |
| filename_and_path = os.path.abspath(filename_and_path) | |
| if os.path.exists(filename_and_path): | |
| break |
| # Open the file in exclusive mode | |
| while ($true) { | |
| try { | |
| $filenameAndPath = Read-Host "Enter filename and path for the file to hold open exclusively" | |
| if ([string]::IsNullOrEmpty($filenameAndPath)) { | |
| Write-Host "No filename was entered. Please provide a valid filename." | |
| continue | |
| } | |
| if (-not [System.IO.Path]::IsPathRooted($filenameAndPath)) { |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| ##################################################### | |
| # Name: Bash CheatSheet for Mac OSX | |
| # | |
| # A little overlook of the Bash basics | |
| # | |
| # Usage: | |
| # | |
| # Author: J. Le Coupanec | |
| # Date: 2014/11/04 |
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |