Skip to content

Instantly share code, notes, and snippets.

View Dainerx's full-sized avatar
💨

Oussama Ben Ghorbel (Dainerx) Dainerx

💨
View GitHub Profile
@Dainerx
Dainerx / google-search-cheatsheet.md
Last active February 29, 2024 10:49
google engine advanced search cheat sheet

My personal Google search cheat sheet with examples.

Operators

- : execludes a term.

Search for Elon Musk but exclude the terms tesla or SpaceX elon musk -tesla -SpaceX


| : search for x or y.

Search for apples or oranges (see images) fruits(apple | orange)

@Dainerx
Dainerx / SelectServiceBeanTest.java
Last active November 21, 2021 16:47 — forked from Toparvion/HOWTO.md
JUnit test for conditional Spring Boot bean registration (@ConditionalOnProperty)
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;
@Dainerx
Dainerx / ChapattiStore.java
Last active November 28, 2020 21:22
Simulating a chapatti store in Java
import java.util.Random;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
public class ChapattiStore {
// Simple builder class for the store
public static class Builder {
private boolean verbose;
private int chappatiToMake;
@Dainerx
Dainerx / chapatti-simulation.go
Last active November 30, 2020 17:17
Simulating a chapatti store
package main
import (
"fmt"
"log"
"math/rand"
"time"
)
type ChappatiStore struct {
@Dainerx
Dainerx / chat.go
Created May 5, 2020 15:41
Chat is a server that lets clients chat with each other
// Chat is a server that lets clients chat with each other.
// For n clients: 2n+2 concurrent communications
package main
import (
"bufio"
"fmt"
"log"
"net"
"time"
@Dainerx
Dainerx / du.go
Last active January 26, 2023 03:26
Unix du command go implementation
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"