Skip to content

Instantly share code, notes, and snippets.

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@kbaribeau
kbaribeau / gist:4495181
Created January 9, 2013 17:46
The source code for the unix `ping` command, taken from here: http://ftp.arl.army.mil/~mike/ping.html
# This is a shell archive. Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file". (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# Makefile ping.1 ping.c ping.shar newping.1 newping.c
echo x - Makefile
cat > "Makefile" << '//E*O*F Makefile//'
@sunmeat
sunmeat / main.cpp
Last active May 3, 2024 17:51
client server UDP C++ example
CLIENT SIDE:
#include <iostream>
#include <winsock2.h>
using namespace std;
#pragma comment(lib,"ws2_32.lib")
#pragma warning(disable:4996)
#define SERVER "127.0.0.1" // or "localhost" - ip address of UDP server
@fb-sean
fb-sean / alternatives-to-mee6.md
Last active May 3, 2024 17:51
A short and good list to alternatives to mee6.

Mee6 Alternatives

Iris XP (Leveling)

Description: Easy to use, fully customisable XP bot.
Link: Invite Iris XP
Credit: @173815235243802624

TempVoice (Temp voice channels)

@nimone
nimone / Sidebar.jsx
Created June 29, 2023 09:33
Retractable Sidebar Component purely in ReactJS and TailwindCSS
import { MoreVertical, ChevronLast, ChevronFirst } from "lucide-react"
import { useContext, createContext, useState } from "react"
const SidebarContext = createContext()
export default function Sidebar({ children }) {
const [expanded, setExpanded] = useState(true)
return (
<aside className="h-screen">
@Artistan
Artistan / EloquentUser.php
Last active May 3, 2024 17:47
Paginator with relations... load the relations on the model
<?php
namespace App;
use Illuminate\Pagination\LengthAwarePaginator;
use App\Http\Controllers\Controller;
class EloquentUser extends Controller {
// these will work for eloquent, but not with a scout->search since scout is not building a query.
public function paginate($query)
@promto-c
promto-c / General-Web-App-GitHub-Pages-Deployment-Guide.md
Created December 28, 2023 16:59
Comprehensive Guides for Deploying React, Node.js, and General Web Applications on GitHub Pages

Deploying a General Web App (HTML, CSS, JS) on GitHub Pages

A step-by-step guide to deploying web applications (using HTML, CSS, JavaScript) on GitHub Pages, categorized into three main sections for ease of understanding and implementation.

Preparing Your Web Application

  1. Create Your Web Application

    • Prepare your web application with HTML, CSS, and JavaScript files. Ensure the entry point of your app is an index.html file.
  2. Organize Your Application

@Cauen
Cauen / code.ts
Last active May 3, 2024 17:39
Prisma Accent Case + Complex Query
// Raw Query
const getUnnacentPersonIdsByNameOrNickname = async (text?: string | null) => {
if (!text) return []
// Search accent case with View
const unnacentLower = (str: string) =>
str
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLocaleLowerCase()
const nameWhere = `unaccent(lower(name)) ilike '%${unnacentLower(