Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
''' | |
This is an example of how to send data to Slack webhooks in Python with the | |
requests module. | |
Detailed documentation of Slack Incoming Webhooks: | |
https://api.slack.com/incoming-webhooks | |
''' | |
import json | |
import requests |
#run this in any directory add -v for verbose | |
#get Pillow (fork of PIL) from pip before running --> pip install Pillow | |
import os | |
import sys | |
from PIL import Image | |
def compressMe(file, verbose=False): | |
filepath = os.path.join(os.getcwd(), file) | |
oldsize = os.stat(filepath).st_size |
mkdir enhanced | |
for sp in *.jpg; do | |
echo "Converting Image: $sp" | |
convert -auto-gamma -auto-level -normalize $sp "enhanced/$sp" | |
done | |
# from http://superuser.com/questions/370920/auto-image-enhance-for-ubuntu |
The following describes how to set up bhyve with Vagrant using the vagrant-bhyve plugin.
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import os | |
import sys | |
import subprocess | |
import argparse | |
def main(work_dir, target_ext, from_encoding, to_encoding): | |
for current_dir, dirnames, fnames in os.walk(work_dir): |
#!/usr/bin/env python | |
""" | |
How to use it: | |
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID`, | |
The Tornado Web Server Will shutdown after process all the request. | |
2. When you run it behind Nginx, it can graceful reboot your production server. | |
""" | |
import time |