Skip to content

Instantly share code, notes, and snippets.

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

tz ✨ tzmartin

🏴‍☠️
ahoy!
View GitHub Profile
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active April 26, 2024 01:50
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 May 1, 2024 14:41
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
}
@tzmartin
tzmartin / pony-render.md
Created September 3, 2016 06:43
Pony render snippet

Pony Render Example

This is deprecated in favor of Remark implementation. Posted here for posterity.

Tokenizer Example

let tokens = Pony.getTokens(str)
console.log(JSON.stringify(tokens))
@tzmartin
tzmartin / awesome-svg-icons.md
Created August 22, 2016 17:50
Awesome SVG Icons
@tzmartin
tzmartin / parse-markdown-for-position.js
Created August 12, 2016 17:00
determine line numbers and starting position from a single markdown string
src = '# Magic Deck\n\n## A markdown editor for creating magical slide shows\n\n---\n\n# How to Use\n\nJust use `---` for each slide and markdown syntax to make it look pretty.\n\nWhen you\'re ready, just use `⌘+R` to render.\n\n---\n\n# Your Turn\n\n';
var index = src.match(new RegExp('---\n\n', "gi")).length;
console.log('Found: ' + index);
var pos = src.indexOf('---\n\n', 75);
console.log('Pos: ' + pos);
@tzmartin
tzmartin / js-software-curriculum-100.md
Last active February 23, 2021 23:52
App (JavaScript) Developer Curriculum 100 - First Steps