You can post a json file with curl
like so:
curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION
so for example:
from subprocess import Popen, PIPE | |
from time import sleep | |
# run the shell as a subprocess: | |
p = Popen(['python', 'shell.py'], | |
stdin = PIPE, stdout = PIPE, stderr = PIPE, shell = False) | |
# issue command: | |
p.stdin.write('command\n') | |
# let the shell output the result: | |
sleep(0.1) |
#! /bin/bash | |
# | |
# Diffusion youtube avec ffmpeg | |
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
VBR="2500k" # Bitrate de la vidéo en sortie | |
FPS="30" # FPS de la vidéo en sortie | |
QUAL="medium" # Preset de qualité FFMPEG | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
#!/bin/bash | |
# | |
# Bash script to setup headless Selenium (uses Xvfb and Chrome) | |
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04 | |
# Add Google Chrome's repo to sources.list | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
# Install Google's public key used for signing packages (e.g. Chrome) | |
# (Source: http://www.google.com/linuxrepositories/) |
import sys, os.path, hashlib, re | |
import zipfile | |
import subprocess | |
from StringIO import StringIO | |
from io import BytesIO | |
# | |
# Passbook Hack | |
# David Schuetz | |
# 30 May 2014 |
(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.
EMOJI CHEAT SHEET
Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.
People
😄
class DisableMigrations(object): | |
def __contains__(self, item): | |
return True | |
def __getitem__(self, item): | |
return "notmigrations" | |
MIGRATION_MODULES = DisableMigrations() |
''' | |
fizzbuzz refers to a quick test to filter applicants for programmer jobs who don't actually know how to code. | |
(see eg, http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/) | |
"pass in a sequence of integers from 1 to 100; | |
for integers that are multiples of three: print “fizz” | |
for integers that are multiples of five print “buzz” | |
for integers that are multiples of five AND three print "fizzbuzz" | |
for remaining integers, print the integer value | |
''' |
class KeyifyList(object): | |
def __init__(self, inner, key): | |
self.inner = inner | |
self.key = key | |
def __len__(self): | |
return len(self.inner) | |
def __getitem__(self, k): | |
return self.key(self.inner[k]) |