Skip to content

Instantly share code, notes, and snippets.

@quant61
quant61 / main.md
Last active February 18, 2018 19:47
Recommended settings for international sites and services

IMHO, best settings for international sites and services are:

  • Timezone: UTC
  • Date format: YYYY-MM-DD
  • Time format: YYYY-MM-DD HH:mm:ss - 24hours, not am/pm
  • Encoding: UTF-8
  • Language: English
  • Timezone: UTC
  • Keyboard layont: En
  • Video: Original sound + English subtitles
<?php
class CartesianIterator implements IteratorAggregate {
private $first;
private $second;
private $add;
public function __construct(iterable $first, iterable $second, callable $add) {
$this->first = $first;
$this->second = $second;
$this->add = $add;
@quant61
quant61 / find-shm-mentions.go
Created July 17, 2022 10:40
Find processes which are using files in /dev/shm
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
)
// TODO: write it in asm
@quant61
quant61 / description.txt
Last active December 14, 2022 06:04
scenario about git branches
A case where switching branches doesn't work as expected.
In my case pushing to dev was prevented by gitlab,
but someone can accidentally push things to master/main while thinking they are pushing to feature branch
@quant61
quant61 / call_nil_func.go
Last active January 15, 2023 19:48
Allocating on zero example
package main
import (
"fmt"
"golang.org/x/sys/unix"
)
func main(){
_, _, e := unix.Syscall6(
unix.SYS_MMAP,