Skip to content

Instantly share code, notes, and snippets.

View Ovilia's full-sized avatar
:octocat:

Wenli Zhang Ovilia

:octocat:
View GitHub Profile
@pissang
pissang / ts-type-guide.md
Last active May 10, 2024 08:45
TypeScript 类型编写指南

TypeScript 类型编写指南

前言

本文主要作为平时在 TypeScript 代码中编写类型以及对 TypeScript 代码进行 review 时候的参考手册,并非强制执行的规范,也不涉及纯代码风格以及代码逻辑上的指导。

前置阅读

本文内容参考了下面几个手册,所以强烈建议能够同时阅读完这几个手册。如果大家对 TypeScript 的一些基础用法和特性还不熟悉,也建议先阅读第一个 TypeScript 手册。

@mjoyce91
mjoyce91 / country-colors.json
Last active January 24, 2024 16:29
Colors of country flags
/*
MIT License
Copyright (c) 2024 Michael Joyce
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@pissang
pissang / milestone2planitpoker.js
Created November 1, 2019 06:24
Github Milestone 2 Planitpoker
const fetch = require('node-fetch');
const MILESTONE_NUMBER = 15;
function assembleIssues(issues) {
return issues.map(issue => {
if (issue.state === 'open') {
return '#' + issue.number + ' ' + issue.title;
}
@timdown
timdown / trim_canvas.js
Created July 26, 2017 16:15
Returns a copy of a canvas element with surrounding transparent space removed
var trimCanvas = (function() {
function rowBlank(imageData, width, y) {
for (var x = 0; x < width; ++x) {
if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false;
}
return true;
}
function columnBlank(imageData, width, x, top, bottom) {
for (var y = top; y < bottom; ++y) {
@erdem
erdem / countries.json
Last active August 30, 2023 11:08
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API