Skip to content

Instantly share code, notes, and snippets.

@pcgeek86
pcgeek86 / install-balena-cli.sh
Last active October 17, 2021 22:16
Install Balena CLI on Debian / Ubuntu
# Trevor Sullivan <trevor@trevorsullivan.net>
export VERSION='v9.12.0'
export FILENAME="balena-cli-$VERSION-linux-x64"
export URL="https://github.com/balena-io/balena-cli/releases/download/$VERSION/$FILENAME.zip"
sudo apt update
sudo apt install httpie unzip --yes
cd $HOME
@spectrvrc
spectrvrc / jwdownloader.py
Created December 10, 2017 09:19
Download JW Player Videos
import requests
import re
def download_file(url):
local_filename = url.split('/')[-1]
r = requests.get(url, stream=True)
with open(local_filename, 'wb') as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
@gumblex
gumblex / num2chinese.py
Created February 8, 2015 02:46
Numbers to Chinese representations converter in Python. 中文数字转换
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed under WTFPL or the Unlicense or CC0.
# This uses Python 3, but it's easy to port to Python 2 by changing
# strings to u'xx'.
import itertools
def num2chinese(num, big=False, simp=True, o=False, twoalt=False):