start new:
tmux
start new with session name:
tmux new -s myname
If you are familiar with Java's generics, and are coming to Rust, you might be lead to assume that its generics are working the same way.
However, due to the different type systems, and different implementation details, there are quite a few differences between generic code in both languages.
This document tries to give a short summary about those differences:
env = Environment( | |
CCFLAGS = ['-Wall', '-Werror'], | |
) | |
env.Program('mkdir_p_test', ['mkdir_p.c', 'test.c']) |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
#include <stdio.h> | |
template <size_t N> | |
struct PrimeTable { | |
constexpr PrimeTable() : sieve() { | |
sieve[0] = sieve[1] = false; | |
for (size_t i = 2; i < N; i++) sieve[i] = true; | |
for (size_t i = 2; i < N; i++) { | |
if (sieve[i]) | |
for (size_t j = i*i; j < N; j += i) sieve[j] = false; |
package com.tomek | |
abstract class Animal(val size: Int) | |
class Dog(val cuteness: Int): Animal(100) | |
class Spider(val terrorFactor: Int): Animal(1) | |
// Covariance |
#!/bin/sh | |
# The script configures simultaneous AP and Managed Mode Wifi on Raspberry Pi Zero W (should also work on Raspberry Pi 3) | |
# Usage: curl https://gist.githubusercontent.com/lukicdarkoo/6b92d182d37d0a10400060d8344f86e4/raw | sh -s WifiSSID WifiPass APSSID APPass | |
# Licence: GPLv3 | |
# Author: Darko Lukic <lukicdarkoo@gmail.com> | |
# Special thanks to: https://albeec13.github.io/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/ | |
MAC_ADDRESS="$(cat /sys/class/net/wlan0/address)" | |
CLIENT_SSID="${1}" | |
CLIENT_PASSPHRASE="${2}" |
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs
import kotlin.coroutines.* | |
import kotlin.coroutines.intrinsics.* | |
/** | |
* Defines deep recursive function that keeps its stack on the heap, | |
* which allows very deep recursive computations that do not use the actual call stack. | |
* To initiate a call to this deep recursive function use its [invoke] function. | |
* As a rule of thumb, it should be used if recursion goes deeper than a thousand calls. | |
* | |
* The [DeepRecursiveFunction] takes one parameter of type [T] and returns a result of type [R]. |
esp=/efi | |
distro=archlinux | |
mkdir -p $esp/EFI/$distro | |
# Generate UEFI Unified Image | |
dracut --force --verbose --kver $(uname -r) $esp/EFI/$distro/linux+initramfs.efi.signed | |
# Create UEFI boot manager entry | |
efibootmgr --quiet --create --disk /dev/disk/by-label/EFI --label 'Arch Linux' --loader /EFI/$distro/linux+initramfs.efi.signed |