Skip to content

Instantly share code, notes, and snippets.

@minaguib
minaguib / gist:83e09e00bbfe7bec1d90870e6e3af51e
Last active July 15, 2023 18:52
Single-DIV CSS progress bar

CSS:

        div {
            position: fixed;
            right: 0;
            background: #ff83c2 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+M/Q/B8ABgYCgg7mTRwAAAAASUVORK5CYII=) no-repeat;
            padding: 1em;
            font: 2em monospace;
            color: white;
 border: 2px solid white;
@minaguib
minaguib / sectigo.md
Last active November 5, 2020 11:12
Sectigo/Comodo/USERTrust/AddTrust Certificate Expiry May 30 2020 notes

Comodo/Sectigo/USERTrust/AddTrust root certificate expiry

On May 30th 2020 (10:48am GMT / 6:48am EDT / 3:48am PDT), several root & intermediate certificates that were part of the Comodo family expired.

The expired certificates

The following certificates expired on May 30 10:48:38 2020 GMT:

@minaguib
minaguib / linux-sparse-files-primer.txt
Created September 11, 2017 19:39
A quick linux sparse file primer
# Create a 10-Meg file
$ dd if=/dev/zero of=foo bs=1024 count=10240
10240+0 records in
10240+0 records out
10485760 bytes (10 MB) copied, 0.0142283 s, 737 MB/s
# Check with ls = 10M
$ ls -la foo
-rw-rw-r-- 1 mina mina 10485760 Sep 11 15:32 foo
@minaguib
minaguib / gist:5254078
Created March 27, 2013 13:16
libevent test - missing error callback after read high watermark reached - with line draining
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <event.h>
#include <event2/bufferevent.h>
#include <event2/listener.h>
#include <event2/buffer.h>
#define PORT 5001
@minaguib
minaguib / gist:5250939
Created March 27, 2013 01:55
libevent test - missing error callback after read high watermark reached
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <event.h>
#include <event2/bufferevent.h>
#include <event2/listener.h>
#define PORT 5001
#define BUFFLEN 4
#define NODRAIN
#
# This class allows you to easily set/default/increment a value in an arbitrarily-deep hash
# using a single (slash)-delimited string
#
class HashSlash < Hash
def slash_set(key, value, value_set_mode = :override)
parts = key.split("/")
h = self
/*
This JS class allows an easy and clean way to assign a "field hint" on input elements' values
usage:
new FieldHint("search_field", "Search...");
It'll set the value of "search_field" to "Search..." whenever it's empty,
It'll erase the hint whenever the user focuses on that field, and restores back the hint if the user leaves the field without entering anything.
Added by Mina Naguib
Trying to get HyperTable going on my mac. Installed it's deps it needed using macports.
Compiling would simply not work, however I finally got it to work under Mac OS X 10.5 (Leopard) after the following changes:
The first problem occurred as soon as you run cmake - got errors about an internal hadoop java file being format 50 while 49 was expected (or vice-versa). fixed with:
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
Next problem was a few seconds into running `make`, it would croak with an error from the linker about being unable to find the symbol "boost::system::get_system_category" - this was fixed by editing cmake/FindBoost.cmake and replacing the whole section (if root matches boost-[0-9]) -> endif with just: