Skip to content

Instantly share code, notes, and snippets.

View rdnvndr's full-sized avatar

Andrey Rodionov rdnvndr

View GitHub Profile
@lee2sman
lee2sman / bash_cheatsheet.md
Last active January 10, 2025 06:31
bash scripting cheatsheet

Bash scripting cheatsheet

  • by Lee2sman
  • Updated 2017-09-18

Bash shebang

  • #!/usr/bin/env bash for portability, or less good, #!/bin/bash

Commenting

#!/bin/bash
# Before running this make sure Caddy and Docker are installed:
# https://gist.github.com/codycraven/bba48dcdcd87a9df4e2bb87834b5a65d
# https://gist.github.com/codycraven/24752be91b676b1c193771a652f4b60d
# Get sudo
sudo echo
# Manual configuration
@sai10
sai10 / Learn-REGex-The-Easy-Way.md
Last active February 1, 2018 18:00
Regular expression is a group of characters or symbols which is used to find a specific pattern from a text. And this is a kind of cheat sheet of learning regular expressions.

Learn Regex


What is Regular Expression?

Regular expression is a group of characters or symbols which is used to find a specific pattern from a text.

A regular expression is a pattern that is matched against a subject string from left to right. The word "Regular expression" is a

cmake_minimum_required(VERSION 3.9.0)
project(proj0)
file(GLOB_RECURSE sources ../src/*.cpp)
file(GLOB_RECURSE sources_test ../src/test/*.cpp)
file(GLOB_RECURSE data ../resources/*)
add_executable(main ${sources} ${data})
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/../bin)
@miguelmota
miguelmota / README.md
Last active October 13, 2024 23:14
GNU screen reference cheat sheet

GNU screen quick reference

http://aperiodic.net/screen/quick_reference

How to Navigate, copy & paste content?

within screen sessions: Cntl a + [ : To start navigation using up/down arrow Press Space bar: To select content starting position

@yizhang82
yizhang82 / host.cpp
Created January 28, 2017 07:43
Simple coreclr host
#include <iostream>
#include <limits.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
#include <set>
#include <dirent.h>
#include <sys/stat.h>
#include "coreclrhost.h"
@multiplemonomials
multiplemonomials / CommandLine.cpp
Last active March 7, 2024 14:41
Cross-platform C++ class to execute programs on both Unix and Windows. Handles program paths and arguments containing spaces. Does not require C++11.
#include <string>
#include <cstring>
#include <vector>
#include <sstream>
#include <cstdio>
#include <iostream>
#ifdef WIN32
# include <fcntl.h>
# include <windows.h>
@tenmyo
tenmyo / initializer.c
Created December 21, 2016 06:11
Initializer/finalizer sample for MSVC and GCC/Clang.
// c - __attribute__((constructor)) equivalent in VC? - Stack Overflow
// http://stackoverflow.com/questions/1113409/attribute-constructor-equivalent-in-vc/2390626#2390626
// Rev.5
// Initializer/finalizer sample for MSVC and GCC/Clang.
// 2010-2016 Joe Lowe. Released into the public domain.
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active October 23, 2025 10:14
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner

Bash Cheat Sheet

Source: http://www.johnstowers.co.nz/blog/pages/bash-cheat-sheet

This file contains short tables of commonly used items in this shell. In most cases the information applies to both the Bourne shell (sh) and the newer bash shell.

Tests (for ifs and loops) are done with [ ] or with the test command.

Checking files