If you, like me, resent every dollar spent on commercial PDF tools,
you might want to know how to change the text content of a PDF without
having to pay for Adobe Acrobat or another PDF tool. I didn't see an
obvious open-source tool that lets you dig into PDF internals, but I
did discover a few useful facts about how PDFs are structured that
I think may prove useful to others (or myself) in the future. They
are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
# Chat with ChatGPT | |
## <span class="text-primary">👉 Note: LangChain is still in development. This script will keep updating to use the latest APIs</span> | |
Use `Kit` -> `Manage npm Packages` -> `Update a Package` -> `langchain` to update to install the latest version. | |
- Opens the `chat` component | |
- Type a message and press `enter` to send | |
- The message is sent to the OpenAI API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Go to Line 153 for the start of Uniform Buffer Object related code and intro | |
Prerequsite: | |
You at least know what uniforms are in the context of WebGL | |
and mininally understand the concepts involved in creating a square in WebGL | |
--> | |
<html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Thank you to the folks at the C++ slack channel, | |
// along with @lewissbaker for the excellent literature | |
// (even though it took me a few days to be convinced | |
// it really was so). | |
#include <uv.h> | |
#include <iostream> | |
#include <experimental/coroutine> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import requests | |
from tqdm import tqdm | |
import re | |
import os | |
def download_file_from_google_drive(id, destination): | |
URL = 'https://docs.google.com/uc?export=download' | |
session = requests.Session() |
If you are getting this in gdb on macOS while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
- Open Keychain Access
- In menu, open Keychain Access > Certificate Assistant > Create a certificate
- Give it a name (e.g.
gdbc
)
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <grpc++/grpc++.h> | |
#include <grpc++/security/credentials.h> | |
#include "pubsub.grpc.pb.h" | |
int main(int argc, char** argv) { | |
auto channel = grpc::CreateChannel(“pubsub.googleapis.com”, grpc::GoogleDefaultCredentials()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This source file is used to print out a stack-trace when your program | |
* segfaults. It is relatively reliable and spot-on accurate. | |
* | |
* This code is in the public domain. Use it as you see fit, some credit | |
* would be appreciated, but is not a prerequisite for usage. Feedback | |
* on it's use would encourage further development and maintenance. | |
* | |
* Due to a bug in gcc-4.x.x you currently have to compile as C++ if you want | |
* demangling to work. |
NewerOlder