Skip to content

Instantly share code, notes, and snippets.

public class CleanArchitectureTests : BaseTests
{
[Fact]
public void CleanArchitecture_Layers_ApplicationDoesNotReferenceInfrastructure()
{
AllTypes.That().ResideInNamespace("CleanArchitecture.Application")
.ShouldNot().HaveDependencyOn("CleanArchitecture.Infrastructure")
.AssertIsSuccessful();
}
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active May 6, 2024 19:05
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@alirezamika
alirezamika / autoscraper-examples.md
Last active May 6, 2024 19:04
AutoScraper Examples

Grouping results and removing unwanted ones

Here we want to scrape product name, price and rating from ebay product pages:

url = 'https://www.ebay.com/itm/Sony-PlayStation-4-PS4-Pro-1TB-4K-Console-Black/203084236670' 

wanted_list = ['Sony PlayStation 4 PS4 Pro 1TB 4K Console - Black', 'US $349.99', '4.8'] 

scraper.build(url, wanted_list)
@avtaniket
avtaniket / cors.php
Last active May 6, 2024 19:02
Handle CORS in PHP
<?php
/* Handle CORS */
// Specify domains from which requests are allowed
header('Access-Control-Allow-Origin: *');
// Specify which request methods are allowed
header('Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS');
@ivanmp91
ivanmp91 / get-daemonset-conflict-node.sh
Last active May 6, 2024 19:02
Get the node name where a daemonset pod cannot be allocated
for i in `kubectl get nodes | awk '{print $1}'` ; do
node=`kubectl get pods -o wide | grep -i $i | grep -i <POD NAME>`
if [ -z "$node" ] ; then
echo "##### $i ######"
fi
done
@daaximus
daaximus / usb.extended.ids
Created April 1, 2023 03:27
Extended USB Device List
This file has been truncated, but you can view the full file.
0000:0000=Device
0000:0002=USB Implementer Forum Mass Storage
0000:3825=USB Mouse
0000:7777=USB Flash Drive
0001:0001=Gaming Optical Mouse5
0001:142b=Arbiter Systems, Inc.
0001:7778=Fry's Electronics Counterfeit flash drive [Kingston]
0002:0002=Ingram passport00
0002:7007=Ingram HPRT XT300
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active May 6, 2024 18:58
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

Script para bloquear IPs Mikrotik

Script para gerar a lista de ips da blacklist https://forum.mikrotik.com/viewtopic.php?t=152632 basta copiar o script abaixo e rodar no terminal.

{
    ip firewall address-list
    :local update do={
        :do {
            :local data ([:tool fetch url=$url output=user as-value]->"data")
@jahtzee
jahtzee / prompts.txt
Last active May 6, 2024 18:57
ChatGPT Jailbreaking prompts, exploits and other fun stuff
These are some exploits, jailbreaks, tricks, whatever you want to call them I've collected and discovered over time.
==== Games and fun stuff ====
== Set up a virtual machine inside GPTs imagination ==
"I want you to act as a Linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd."
== Play a tabletop RPG with GPT as the dungeon master ==
"I want you to act as the dungeon master (DM) of a role playing game. Answer and act only in a way that a dungeon master would.
You are setting up a role playing game with only one other player. Everything you say as the dungeon master begins with (DM): followed by whatever you want to say. You will regularly ask me, the player, to
@c0m4r
c0m4r / freebsd_hetzner_cloud_vps.md
Last active May 6, 2024 18:56
FreeBSD installation on Hetzner Cloud VPS