You will need:
This guide is based on Ubuntu, for other OS, use their package manager instead.
""" | |
This gist shows how to run asyncio loop in a separate thread. | |
It could be useful if you want to mix sync and async code together. | |
Python 3.7+ | |
""" | |
import asyncio | |
from datetime import datetime | |
from threading import Thread | |
from typing import Tuple, List, Iterable |
You will need:
This guide is based on Ubuntu, for other OS, use their package manager instead.
When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:
const Promise = require('bluebird'); | |
const path = require('path'); | |
const fs = require('fs-extra'); | |
const stat = Promise.promisify(fs.stat); | |
const glob = Promise.promisify(require('glob')); | |
const tarstream = require('tar-stream'); | |
const zlib = require('zlib'); | |
const express = require('express'); | |
function targzGlobStream(globString, options) { |
Command Flags
Flag | Options | Description |
---|---|---|
-codec:a |
libfaac, libfdk_aac, libvorbis | Audio Codec |
-quality |
best, good, realtime | Video Quality |
-b:a |
128k, 192k, 256k, 320k | Audio Bitrate |
-codec:v |
mpeg4, libx264, libvpx-vp9 | Video Codec |
# Pass the env-vars to MYCOMMAND | |
eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
# … or ... | |
# Export the vars in .env into your shell: | |
export $(egrep -v '^#' .env | xargs) |
Using iterators and generators in multi-threaded applications | |
24 May 2012 – Bangalore | |
Python iterators and generators have almost the same behavior, but there are subtle differences, especially when the iterator/generator is used in a multi-threaded application. | |
Here is an example to demonstrate that behavior. | |
import threading | |
def count(): |
(module | |
(func $addTwo (param i32 i32) (result i32) | |
(i32.add | |
(get_local 0) | |
(get_local 1))) | |
(export "addTwo" (func $addTwo))) |
#!/boot/bzImage | |
# Linux kernel userspace initialization code, translated to bash | |
# (Minus floppy disk handling, because seriously, it's 2017.) | |
# Not 100% accurate, but gives you a good idea of how kernel init works | |
# GPLv2, Copyright 2017 Hector Martin <[email protected]> | |
# Based on Linux 4.10-rc2. | |
# Note: pretend chroot is a builtin and affects the current process | |
# Note: kernel actually uses major/minor device numbers instead of device name |