Skip to content

Instantly share code, notes, and snippets.

View Peter-developer01's full-sized avatar
💡
Has been always puzzling me...

Peter Peter-developer01

💡
Has been always puzzling me...
View GitHub Profile
@ndkhoa
ndkhoa / git.prune.md
Last active March 29, 2026 14:02
Clean up unreachable or orphaned git objects with git prune

Clean up unreachable or orphaned git objects with git prune

Unreachable objects are those that are not accessible by any refs. As an example, say we have made two commits, and reset them to different heads by calling git reset <commit_id> command. Though the git log command will not show the commit info, git still stores it internally as a dangling object.

Find the dangling commit

git fsck --lost-found
@Glorfindel83
Glorfindel83 / broken-image-repairer.md
Last active August 1, 2025 09:17
Broken Image Repairer

Broken Image Repairer

What is the problem?

A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like

alt text http://example.com/image.png

instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).

Вот пример C++ кода, который выглядит очень странно. Почему-то, когда данные отсортированы код выполняется почти в шесть раз быстрее.
<!-- language: lang-cpp -->
#include <algorithm>
#include <ctime>
#include <iostream>
int main()
{
@NickCraver
NickCraver / Build.xml
Last active June 28, 2024 07:54
Stack Overflow Build Reference Docs
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Passed in Parameters -->
<configuration></configuration>
<workingDir></workingDir>
<buildNumber></buildNumber>
<buildViews>false</buildViews>
<minifyJs>true</minifyJs>
<TargetsDirectory></TargetsDirectory>
@francislewis
francislewis / Never run
Created February 25, 2015 21:44
Linux commands you probably shouldn't run
#Pretty much a denial of service attack, self replicates to use resources.
:(){ :|: & };:
# just rm -rf / in hex
char esp[] __attribute__ ((section(“.text”))) /* e.s.p
release */
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #