Skip to content

Instantly share code, notes, and snippets.

View faizul726's full-sized avatar

Fzul faizul726

View GitHub Profile
@ThomasVille
ThomasVille / remove_json_comments.sh
Last active March 28, 2025 09:04
Remove comments from JSON file
# This sed command removes every C-style single line comments (//) from a file that can contain strings delimited by `"`
# (intended for use with JSON files).
# So this JSON:
# {
# "app url": "https://www.example.com" // URL of the application
# }
# becomes:
# {
# "app url": "https://www.example.com"
# }
@omarrodriguez15
omarrodriguez15 / ConvertTo-CompatJson.ps1
Last active November 24, 2024 11:04
Remove comments from json so that powershell can convert it into a Object without throwing up.
Get-Content .\settings.json | %{ if ($_.Contains('//')){ $_.SubString(0, $_.IndexOf('//')) } else {$_}} | ConvertFrom-Json
@pavelburov
pavelburov / set_command_output_to_variable.bat
Created January 26, 2018 14:10
windows batch (bat, cmd) - How to set command output to variable
for /f %%i in ('application arg0 arg1') do set VARIABLE=%%i
echo %VARIABLE%