Let’s say we have these files:
ls
to_be_renamed_1.txt
to_be_renamed_2.txt
to_be_renamed_3.txt
#!/usr/bin/env ruby | |
require 'benchmark' | |
require File.expand_path('../config/environment', __FILE__) | |
begin | |
@list = (0..10_000).map{|i| {word: "word_#{i}", word_translation: "translation_#{i}"}} | |
@vocabulary_1 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #1") | |
@vocabulary_2 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #2") | |
@vocabulary_3 = Vocabulary.create(user_id: User.first.id, title: "Vocabulary #3") |
redis-cli KEYS 'icc*' | xargs -d '\n' redis-cli DEL |
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
def fuzzyfinder(p, l): | |
return map(lambda t: t[0], sorted(filter(lambda t: all(map(lambda x: x != -1, t[1])), map(lambda s: (s,map(s.find, p)), l)), key=lambda t: t[1])) |
''' | |
I started one server: | |
$ python aiohttp_rq.py server | |
And three workers in different terminals: | |
$ python aiohttp_rq.py worker | |
And I got next results with ab: |
""" | |
Automatic migration of subscriptions to another | |
YouTube account with Python and Selenium. | |
Tested with: | |
- selenium 3.0 | |
- firefox 49.0 | |
- python 3.5 | |
1. Install selenium from pypi: |
Often you are handed-out big CSV files and need to sort, filter, update some cells or other tedious work.
You tried sed
, jq
, and maybe the mighty awk
.
But at the end of the day: You’re using the wrong tool for the job.
Here come csvkit’s csvsql, a small Python script to parse your CSV files and create the corresponding database. You now have the best tool, SQL, to answer your data questions:
Sometimes you just need to quickly take some notes.
A trick is to use the data:
scheme with data:text/html
to show just a piece of HTML in your browser.
Then using the mighty contentEditable
to make the whole thing editable.
To copy/paste into your browser address bar:
data:text/html,<html contenteditable>