⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
| #!/usr/bin/python | |
| import subprocess | |
| import re | |
| # Get process info | |
| ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], | |
| stdout=subprocess.PIPE).communicate()[0].decode() | |
| vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[ | |
| 0].decode() |
So there were a few threads going around recently about a challenge to write the longest sequence of keywords in Javascript:
- https://twitter.com/bterlson/status/1093624668903268352
- https://news.ycombinator.com/item?id=19102367
There are, however, a few problems:
This document contains some of the ffmpeg snippets I use most commonly, and typically in the context of converting research-related image data to video. It is not meant to be exhaustive.
- Documentation: https://ffmpeg.org/ffmpeg.html
- Superuser community: https://superuser.com/questions/tagged/ffmpeg
- More on concatenation / named pipes: https://trac.ffmpeg.org/wiki/Concatenate
- A tutorial: Learn FFmpeg libav the Hard Way
| import {Action, ActionCreator, Dispatch} from 'redux'; | |
| import {ThunkAction} from 'redux-thunk'; | |
| // Redux action | |
| const reduxAction: ActionCreator<Action> = (text: string) => { | |
| return { | |
| type: SET_TEXT, | |
| text | |
| }; | |
| }; |
| // from: https://github.com/styled-components/styled-components/issues/416#issuecomment-276230181 | |
| import React from 'react'; | |
| import classnames from 'classnames'; | |
| import styled from 'styled-components'; | |
| import { ContainerQuery } from 'react-container-query'; | |
| const query = { | |
| 'box1': { | |
| minWidth: 250, |
From episode "5 - Setting Up Universal Links (Deep Linking)" on the Inside iOS Dev Podcast
1) Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle.
- Create
apple-app-site-associationtext file without.jsonfile extension - Use
application/jsonMIME type for the text file - Have the following contents of the file similar to this format:
{ "applinks": {
"apps": [],
| session_engines = {} | |
| def get_new_session(connection=None, autocommit=None): | |
| connection = connection or 'default' | |
| connection_settings = settings.DATABASES[connection] | |
| connection_autocommit = ValueUtils.none_or( | |
| connection_settings.get('autocommit'), False) | |
| autocommit = ValueUtils.none_or(autocommit, connection_autocommit) |
I get a lot of questions about what I think about Vue.
I won't comment too much on Vue in general because I'm not familar enough with it, but I'm very familiar with templating systems, and in articles praising Vue, the fact that it uses templating system instead of JSX is almost always cited as a reason to choose Vue. This drives me up the friggin' wall, because the negative side effects of templates are not communicated or discussed. JSX exists for good reasons. To me, JSX is a great simplification and clear improvement over templates.
Template languages are often sold on looking superficially good. I recently ran across yet another one of these articles citing the wonders of Vue, and especially templates. In this article, this JSX example is included:
Brought to you by Headjack
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.
Let's start with some basics:
ffmpegcalls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file