When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}| PYBIND11_INCLUDE ?= # -Ipath/to/pybind/include if not in other paths | |
| PREFIX ?= $(shell python3-config --prefix) | |
| INCLUDES = ${PYBIND11_INCLUDE} -I${PREFIX}/include/python3.6m -I${PREFIX}/include | |
| CFLAGS = -std=c++11 ${INCLUDES} | |
| LDFLAGS = -arch x86_64 -L${PREFIX}/lib -lpython3.6m -ldl | |
| foobar.so: foobar.cpp |
| function saveGmailAsPDF() { | |
| var gmailLabels = "PDF"; | |
| var driveFolder = "My Gmail"; | |
| var threads = GmailApp.search("in:" + gmailLabels); // optional count limit:, 0, 5); | |
| if (threads.length > 0) { | |
| /* Google Drive folder where the Files would be saved */ |
Disclaimer: the boundaries of what really qualifies as "domain-specific" as opposed to "somewhat specialized or different" isn't always crisp, so I'm casting a slightly wide net.
This is a simple, should-be-drop-in replacement for the old /System/Library/Printers/Libraries/quartzfilter utility which went away circa OS X 10.8.
Usage:
chmod +x quartzfilter.js
./quartzfilter.js infile.pdf filter.qsfilter outfile.pdf
e.g.,
./quartzfilter.js my-big-pdf.pdf "/System/Library/Filters/Reduce File Size.qfilter" my-less-big-pdf.pdf
| // This algorithm is meant to be equivalent to CV_TM_CCOEFF_NORMED in OpenCV, and normxcorr2 in MATLAB: | |
| // via http://stackoverflow.com/q/31060974/3815 | |
| #include <Halide.h> | |
| typedef uint8_t pixel_t; | |
| void normxcorr( Halide::ImageParam input, | |
| Halide::ImageParam kernel, | |
| Halide::Param<pixel_t> kernel_mean, |
| #include "elf.h" | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| void saveELF(const char *filename, void *buf, size_t len) { | |
| FILE *f = fopen(filename, "w"); | |
| struct elf64_hdr { |
| #include "jo_jpeg.cpp" // http://www.jonolick.com/uploads/7/9/2/1/7921194/jo_jpeg.cpp | |
| template<typename T> | |
| void save_jpeg(Image<T> im, std::string filename, int quality = 90) { | |
| _assert(im.channels() > 0 && im.channels() < 5, | |
| "Can't write JPEG files that have other than 1, 2, 3, or 4 channels\n"); | |
| im.copy_to_host(); | |
| // convert to 8-bit and interleave |
| // g++ local_histogram*.cpp -g -I ../include -L ../bin -lHalide -o local_histogram | |
| // DYLD_LIBRARY_PATH=../bin ./local_histogram | |
| #include <Halide.h> | |
| #include <stdio.h> | |
| using namespace Halide; | |
| #include "image_io.h" | |
| int main(int argc, char **argv) { | |
| Var x,y,v; |