Skip to content

Instantly share code, notes, and snippets.

View gaols's full-sized avatar
🌴
On vacation

gaols gaols

🌴
On vacation
View GitHub Profile
@incubated-geek-cc
incubated-geek-cc / codeEditor.html
Last active June 12, 2022 13:25
Enabling line number to a Textarea component.
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='description' content='line numbering textarea editor demo'>
<meta name='keywords' content='line numbering,textarea,editor'>
<meta name='viewport' content='width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' />
<meta http-equiv='X-UA-Compatible' content='IE=Edge,chrome=1' />
<meta http-equiv='Content-Language' content='en' />
<title>Line Numbering to Textarea Demo</title>
@weihanglo
weihanglo / draw_gradient_pillow.py
Last active May 8, 2024 09:09
Draw gradient color with Pillow
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw
im = Image.open('img_original.png')
def interpolate(f_co, t_co, interval):
det_co =[(t - f) / interval for f , t in zip(f_co, t_co)]
for i in range(interval):
@DarrenN
DarrenN / get-npm-package-version
Last active April 12, 2025 14:15 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION