This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var getterPropInstance = new GetterAutoProp(); | |
Console.WriteLine(getterPropInstance.RandomInt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/fish | |
if status --is-interactive | |
echo an interactive shell | |
else | |
echo not an interactive shell | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ABCDEFGHIJKLMNOPQRSTUVWXYZ | |
abcdefghijklmnopqrstuvwxyz | |
~!@#$%^&*()[]{}<>_+-=,.:;?/\|'" | |
0123456789 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Reads from specified shell history file. | |
HISTFILE=~/.bash_history | |
# Enable history. Disabled by default in a non-interactive shell (e.g. scripts like this). | |
# Uses awk to get just the command name from shell history, sorts list by command name, filters out non-unique data, sorts by frequency, grabs top 5. | |
set -o history | |
history | awk '{print $2}' | sort | uniq -c | sort -nr | head -5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " disable vi compatibility | |
syntax on " enable syntax highlighting | |
set background=dark " dark or light. used to help inform syntax highlighting colors | |
set number " enable line numbers | |
" | |
" configure tab width and insert spaces instead of tabs | |
" https://stackoverflow.com/questions/1562336/tab-vs-space-preferences-in-vim | |
" | |
set expandtab " expand tabs to spaces | |
set tabstop=2 " set tab width to 2 spaces |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iomanip> | |
#include <iostream> | |
#include <numbers> | |
// Uses C++20 features. | |
void PrintPi() { | |
std::cout << std::setprecision(16) << std::numbers::pi_v<long double> << '\n'; | |
} | |
int main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# stop script on first error | |
set -e | |
mkdir gcc_for_raspberrypi | |
cd gcc_for_raspberrypi | |
# variables that define the result | |
install_dir="$(pwd)/install" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::string; | |
int main() { | |
// Uses C++11 features. | |
string os{}; | |
// Detect operating system. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// () parentheses or parens | |
// ( open paren | |
// ) close paren | |
// [] square brackets | |
// {} curly braces | |
// <> angle brackets | |
#include <iostream> | |
int main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::string; | |
int main() { | |
auto pi = "pi is " + std::to_string(3.14); | |
cout << pi << '\n'; | |
return 0; | |
} |