Skip to content

Instantly share code, notes, and snippets.

View HADB's full-sized avatar

Bean Deng 邓斌 HADB

View GitHub Profile
@HADB
HADB / fetch-starcraft-2-ladders-data-of-kr-region.md
Last active November 15, 2021 08:58
Two ways to fetch starcraft 2 ladders data of KR region

Hi, there! Here's how I fetch the data of KR region in sczone-crawler.

We know that the League api and Legacy Ladder api are not working as expected in KR region. But other apis still work. So we just have to find a way to get the ladders.

An inefficient way:

  1. Loop all the characters of KR.
  2. Use Profile Ladder Summary api (/sc2/profile/:regionId/:realmId/:profileId/ladder/summary) with each profileId above to get all ladders of each character.
  3. Use Profile Ladder api (/sc2/profile/:regionId/:realmId/:profileId/ladder/:ladderId) with profileId and ladderId above to get all teams of each ladder.
  4. Add new characters found in these ladder teams.
@GaryLee
GaryLee / ttf2svg.py
Last active October 27, 2023 08:57
Convert TTF to SVG. This script loads font of given character from TTF file and generate SVG file.
#!python3
# Convert character of TTF to SVG.
# Author: "Gary Lee" <garywlee@gmail.com>
# Usage: ttf2svg.py [char] [OUTPUT_FILE] [TTF_FONT]
# Example: ttf2svg.py A A.svg /Library/Fonts/arial.ttf'
#
# Requirement:
# - pip3 install freetype-py
# - pip3 install svgpathtools
@p3t3r67x0
p3t3r67x0 / convert_truetype.md
Last active November 26, 2023 16:54
Create a svg from truetype font with freetype and svgpathtools in python

Create a svg from truetype font in python

I am trying to create a svg file from a truetype font with freetype-py and svgpathtools. I have a working python code which generates the svg file but unfortunately there are some corners and edges where instead should be smooth curves. Here in this example I try to render an special char which does not look good at all.

Question

What do I need to change in order to get curve symbols redered correctly?

Prerequisites

@CatherineH
CatherineH / text_to_svg_path.py
Last active December 5, 2023 13:41
Convert a text character to an SVG path.
from svgpathtools import wsvg, Line, QuadraticBezier, Path
from freetype import Face
def tuple_to_imag(t):
return t[0] + t[1] * 1j
face = Face('./Vera.ttf')
@sunnylqm
sunnylqm / .eslintrc
Created August 18, 2016 15:21
eslint for reactnative
{
"extends": "airbnb",
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true,
"mocha": true
},
"rules": {
// Disable for __DEV__, __SERVER__ usage.
@huqi
huqi / trial.key
Created April 11, 2015 09:01
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t