Skip to content

Instantly share code, notes, and snippets.

View tzmartin's full-sized avatar
🏴‍☠️
ahoy!

tz ✨ tzmartin

🏴‍☠️
ahoy!
View GitHub Profile
@tzmartin
tzmartin / gitsubmodules.md
Last active January 3, 2021 17:23
Say NO to Git Submodules

I really don't like submodules in Git. There's a much better way:

$ git remote add -f svbhack https://github.com/gfidente/pelican-svbhack.git
$ git merge -s ours --no-commit svbhack/master
$ git read-tree --prefix=themes/svbhack -u svbhack/master
$ echo "THEME = 'themes/svbhack'" > pelicanconf.py
$ git commit -m 'Import svbhack theme'
@tzmartin
tzmartin / ml-datasets.md
Last active January 3, 2021 17:23
Datasets for machine learning

Image datasets

Dataset Training Set Size Testing Set Size Number of Classes Comments
Flowers 2500 2500 5 Various sizes (source: Flickr)
Cifar10 60k 10k 10 32x32 color
MNIST 60k 10k 10 28x28 gray
ImageNet 1.2M 50k 1000 Various sizes
MSCOCO 80k 40k 80 Various sizes
@tzmartin
tzmartin / competitive-analysis.md
Last active March 26, 2017 19:00
Emperically analyzing a competitor, business or person

Competitive Analysis Process

Note: this is a live doc

Define Profile

Open-source intelligence (OSINT)

Extract intel on domain / email / username / phone with OSINT tools.

@tzmartin
tzmartin / latency.txt
Created March 14, 2017 20:25 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active March 3, 2025 19:49
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@tzmartin
tzmartin / china-ai-robotics-vc.md
Created December 6, 2016 17:25
China has now eclipsed US in AI / deep-learning research, robotics and VC funding (government-backed $338 billion)
@tzmartin
tzmartin / embedded-file-viewer.md
Last active March 10, 2025 16:56
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@tzmartin
tzmartin / README
Created September 18, 2016 05:46 — forked from diverted247/README
Export slides from Google Slides as SVG - Console Script (Chrome tested)
To export SVG from Google Slides.
1. Open Slide deck.
2. View -> 100%
3. Click on every thumbnail from first to last, this puts the SVG into the DOM.
4. Paste the export.js in the console.
5. Make sure to allow multiple downloads.
6. All SVG should be in Downloads folder.
Cheers,
@tzmartin
tzmartin / dom-element-screen-capture.md
Created September 18, 2016 01:44
DOM element screen capture

"Fakes" an element capture by cropping a full screen image to the boundaries of a DOM element

var canvas = null;
function capture(tabId, dimensions) {
    chrome.tabs.get(tabId, function(tab) {
        chrome.tabs.captureVisibleTab(tab.windowId, { format: "png" }, function(dataUrl) {
            if (!canvas) {
                canvas = document.createElement("canvas");
                document.body.appendChild(canvas);
p {
font-size:18px;
line-height:24px;
text-align: justify;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAbCAYAAAC5rTVJAAAA3ElEQVQY0wXBwU3CABQA0Oe3IVgarFpDwYNH41GvLuMYzuQ4boBKiqGBptbCoQHf8+b19C4/vb44RWElmTdWEyJXaUuqMZFaO1zykxCJ2nDBJoghoxnjeCv6lHqEYSaaKdsc+4WoMz5nN/QLsZ7wcXjkrxSrCdvjE10hqjG+zmlz8ZOgSehTsQkcS7pEON6yD4VBGGa0Y6Ve2C/YPptrhH7h+vvgTi38lR7USmuhK9zrZZZCm7uy1VkKfSrVoRa6xJmdQisKA1qjlCj1Er/SjJhrDCrNlLhTK+3UGf/2IVZs3eANJQAAAABJRU5ErkJggg==);
background-size:100% 72px;
-webkit-background-clip:text;
-webkit-text-fill-color:transparent
}