Skip to content

Instantly share code, notes, and snippets.

View sljeff's full-sized avatar
🚩
Flag

Kind Jeff sljeff

🚩
Flag
View GitHub Profile
@sljeff
sljeff / pip-upgrade-all-packages.py
Created October 8, 2016 00:51
pip upgrade all packages
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
@sljeff
sljeff / video_to_audio.py
Created November 25, 2016 02:44
python. convert video to audio.
# coding: utf-8
import moviepy.editor as mp
import sys
def convert(video_file_name, audio_file_name=None):
if audio_file_name is None:
audio_file_name = video_file_name + '.mp3'
try:
clip = mp.VideoFileClip(video_file_name)
clip.audio.write_audiofile(audio_file_name)
from PIL import Image
img = Image.open("QQwhite.jpg")
width, height = img.size
result = Image.new('RGB', (width, height))
data = list(img.getdata())
for i, t in enumerate(data):
if set(t) == {255}:
clash
Python 20 mins █████████████████▎░░░ 82.2%
Other 4 mins ███▌░░░░░░░░░░░░░░░░░ 16.8%
XML 0 secs ▏░░░░░░░░░░░░░░░░░░░░ 1.1%
🏆 205 Contributions in year 2020
📦 Used 24 MB in GitHub's Storage
📜 7 Public Gists
🔑 5 Public Keys
💼 Opted to Hire
#!/bin/bash
install_ipset() {
yum install -y ipset ipvsadm
}
load_mod() {
echo "#!/bin/bash
modprobe -- ip_vs
modprobe -- ip_vs_rr
{
"configurations":{
"Debug GRPC":{
"adapter":"vscode-go",
"configuration":{
"type":"go",
"request":"launch",
"mode":"debug",
"remotePath":"",
"port":2345,
@sljeff
sljeff / phones.md
Last active December 17, 2023 12:04
我用过的手机,纯记录
  • 天语功能机
  • 振华MTK山寨机
  • 多普达 696
  • HTC G1
  • HTC G6
  • iPhone 4
  • HTC G18
  • HTC G23 (One X)
  • iPhone 5s
  • iPhone 6