Simple glob:
ffmpeg -r 24 -i '*.JPG' -s hd1080 -vcodec libx264 timelapse.mp4
Start from DSC_0079.JPG
ffmpeg -r 24 -f image2 -start_number 79 -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse2.mp4
"""A simple demonstration of running background tasks with Tornado. | |
Here I am using a basic TCP server which handles streams and keeps | |
them open while asynchronously performing a fake task in the | |
background. In order to test it, simply telnet to localhost port 8080 | |
and start typing things to see that the server receives the messages. | |
The advantage to running on an executor instead of conventional | |
threads is that we can more easily shut it down by stopping the | |
tornado IO loop. |
Qlobe is a fascinating example of quine in Ruby, submitted by a member of the Ruby core team - Yusuke Endoh.
Programs that output changed executable versions of themselves while managing to spin the globe and still remaining executable are cool, right?
To experience its magic, run the following
curl -fSSl https://gist.githubusercontent.com/shime/f0ebe84ca42c33b51d42/raw/5e74315dc6b6fe572f8a457536ad7eb17ad3f1e4/qlobe.rb > qlobe.rb; while true; do ruby qlobe.rb | tee temp.rb; sleep 1; mv -f temp.rb qlobe.rb; done
import UIKit | |
import Foundation | |
import XCPlayground | |
XCPSetExecutionShouldContinueIndefinitely() | |
class RemoteAPI { | |
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void { | |
let url: NSURL = NSURL(string: "http://itunes.apple.com/search?term=Turistforeningen&media=software") | |
let ses = NSURLSession.sharedSession() |
Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.
The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows
the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir
and you are good to go.
Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to
a specific version, you will need to compile it yourself. Then asdf
is your best friend.
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)from socket import socket, SO_REUSEADDR, SOL_SOCKET | |
from asyncio import Task, coroutine, get_event_loop | |
class Peer(object): | |
def __init__(self, server, sock, name): | |
self.loop = server.loop | |
self.name = name | |
self._sock = sock | |
self._server = server | |
Task(self._peer_handler()) |
This workshop will cover the basics of the CPython runtime and interpreter. There is an enormous amount of material to cover, and I'll try to to rush through as much as I can.