Skip to content

Instantly share code, notes, and snippets.

View hashimaziz1's full-sized avatar

Hashim Aziz hashimaziz1

View GitHub Profile
@hashimaziz1
hashimaziz1 / iszero-fast.cpp
Created September 21, 2020 19:07 — forked from BobVul/iszero-fast.cpp
Check for nonzero data in a stream, quickly and without output. Answers http://superuser.com/q/559772/117590.
#include <cstdio>
#define BUFFER_SIZE 1024
int main() {
FILE* file = stdin;
char buffer[BUFFER_SIZE];
long long bytes_read = 0;
while (bytes_read = fread(buffer, 1, BUFFER_SIZE, file)) {
@hashimaziz1
hashimaziz1 / .gitignore
Created September 13, 2019 21:14
This modified version of Bill Erickson's .gitignore file for Wordpress differs in that I chose to include all plugins so I can quickly use Git to see whether any have been infected by malware. I also added the .vscode folder to the ignore list, and changed "ehthumbs.db" to "thumbs.db", which was likely the original intention.
# Ignore everything except plugins... #
**
!wp-content/
wp-content/**
!wp-content/themes/
wp-content/themes/**
!wp-content/plugins/
!wp-content/plugins/**
!wp-content/mu-plugins/
!wp-content/mu-plugins/**