Skip to content

Instantly share code, notes, and snippets.

View ildar-shaimordanov's full-sized avatar

Ildar Shaimordanov ildar-shaimordanov

View GitHub Profile
cue_file = 'file.cue'
d = open(cue_file).read().splitlines()
general = {}
tracks = []
current_file = None
0</*! ::
@echo off
echo:Hello, batch!
cscript //nologo //e:jscript "%~f0" %*
echo:Hello, batch again!
goto :EOF
@ildar-shaimordanov
ildar-shaimordanov / wsh-commonjs.js
Last active October 18, 2015 14:45
CommonJS functions for WSH JScript
/* this code is public domain */
function require(path)
{
var fso = WScript.CreateObject("Scripting.FileSystemObject");
var file_path = path + ".js";
var input_stream = fso.OpenTextFile(file_path, 1, false);
var module_code = input_stream.ReadAll();
input_stream.Close();
var eval_code = "(function(){" +
@ECHO OFF
REM -- Automates cygwin installation
SETLOCAL
REM -- Change to the directory of the executing batch file
CD %~dp0
REM -- Configure our paths
SET SITE=http://mirrors.kernel.org/sourceware/cygwin/
@ildar-shaimordanov
ildar-shaimordanov / pre-push.sh
Created October 28, 2015 22:01 — forked from pixelhandler/pre-push.sh
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@ildar-shaimordanov
ildar-shaimordanov / cygrun.sh
Created April 25, 2016 01:29 — forked from gene-pavlovsky/cygrun.sh
Cygwin: run a Cygwin or Windows program with pathname arguments converted to UNIX or Windows format.
#!/bin/bash
#
# Run a program, converting UNIX and Windows format path arguments.
#
# Install in Cygwin's `bin` dir or elsewhere in your path.
# Create a symlink for convenience: `ln -s cygrun.sh cygrun`.
#
# Use `cygrun -w windows-program unix-path ...` to run Windows programs (e.g. from UNIX software).
# E.g., in my .gitconfig core.editor is set to `cygrun -w 'C:/Program Files/Notepad2/Notepad2.exe'`.
#
@ildar-shaimordanov
ildar-shaimordanov / Get-IniContent.ps1
Created August 31, 2018 17:51 — forked from hsmalley/Get-IniContent.ps1
Powershell to/from INI Files
function Get-IniContent ($filePath)
{
$ini = @{}
switch -regex -file $FilePath
{
"^\[(.+)\]" # Section
{
$section = $matches[1]
$ini[$section] = @{}
$CommentCount = 0
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@ildar-shaimordanov
ildar-shaimordanov / telnet-like.md
Last active March 13, 2024 12:16 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@ildar-shaimordanov
ildar-shaimordanov / ANSI.md
Created June 5, 2024 16:24 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27