Skip to content

Instantly share code, notes, and snippets.

View emeraldhieu's full-sized avatar
😁
Never look back

Hieu emeraldhieu

😁
Never look back
View GitHub Profile
@Genzer
Genzer / TestCheckSumLargeRandomInpustStream.java
Last active July 12, 2023 05:06
Testing generating MD5/SHA256 checksum with arbitrary size InputStream
//usr/bin/env jshell
import java.io.InputStream;
import java.io.OutputStream;
import java.security.MessageDigest;
import java.security.DigestInputStream;
/**
* A super elegant way to produce a `InputStream` at any size using an iterating
* approach (Stream-like).
* This was copied from https://www.nurkiewicz.com/2014/07/building-extremely-large-in-memory.html
@mkgl
mkgl / bookmarklet.js
Last active September 23, 2017 16:53
javascript:(function(p){s=location.search;if(!s.includes("?"+p)&&!s.includes("&"+p))location.search+=s.startsWith("?")?"&"+p:"?"+p})("restartApplication")
@kaito834
kaito834 / curl_multipart-mixed_sample.bat
Created June 27, 2015 06:10
send a HTTP request which Content-Type is 'multipart/mixed' by cURL
@echo off
REM http://curl.haxx.se/docs/manpage.html#-F
REM http://curl.haxx.se/mail/archive-2010-03/0049.html
REM cURL installed with msysgit is used on this batch.
REM Output of "curl -V" is below
REM curl 7.41.0 (i386-pc-win32) libcurl/7.41.0 OpenSSL/0.9.8zf zlib/1.2.8
REM Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
REM Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz
set curlPath="C:\Program Files (x86)\Git\bin\curl.exe"