Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
# aecho.py | |
from socket import * | |
import asyncio | |
loop = asyncio.get_event_loop() | |
async def echo_server(address): | |
sock = socket(AF_INET, SOCK_STREAM) | |
sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) |
#!/usr/bin/env python | |
from datetime import datetime | |
from json import loads | |
from time import gmtime, mktime, strptime | |
# LevelDict é um wrapper usando dicionário para LevelDB | |
# https://github.com/maurobaraldi/leveldict | |
from leveldict import LevelJsonDict | |
from requests import get |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
import timeit | |
t = timeit.Timer("v=sorted(d.items(), key=lambda x: x[1])[-1]", | |
"d = {'a': 1000, 'b': 3000, 'c':100}") | |
print t.timeit() | |
# 1.648s | |
t = timeit.Timer("v=max(d.iteritems(), key = operator.itemgetter(1))[0]", | |
"import operator; d = {'a': 1000, 'b': 3000, 'c':100}") | |
print t.timeit() |
#!/bin/bash | |
find . -name '*.CR2' -print0 | while read -r -d '' FILE | |
do | |
BASENAME=$(basename -s ".CR2" "$FILE") | |
exiftool -b -previewImage -ext .CR2 -w .JPG "$FILE" | |
exiftool -tagsFromFile "$FILE" "$BASENAME".JPG | |
done |
This is companion code to this guide.
""" | |
Copyright (c) 2012 Zohaib Sibte Hassan | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
%%% Run with 'escript app_deps.erl' | |
%%% Change the path in filelib:wildcard/1 as required to capture all | |
%%% your dependencies. | |
%%% | |
%%% Rectangular nodes will represent library apps (no processes involved) | |
%%% and the circular nodes will represent regular apps. An arrow going from | |
%%% 'A -> B' means 'A depends on B'. | |
%%% | |
%%% This script depends on graphviz being present on the system. | |
-module(app_deps). |
Hojeee é mais uma segunda-feira, | |
a patroa ta avisada, | |
não tenho hora pra voltar. | |
Vou pro bar com amigos, | |
Entre uma cerveja e outra, | |
não vejo a hora passar | |
Conversa nerd, filosófica ou afiada | |
o que importa é a cervejada |
# ~/.gitconfig | |
[branch] | |
autosetupmerge = true | |
[push] | |
default = current | |
[core] | |
excludesfile = .gitignore |