Skip to content

Instantly share code, notes, and snippets.

View kmvan's full-sized avatar
🌏
What is the end and ultimate purpose of the universe?

Km.Van kmvan

🌏
What is the end and ultimate purpose of the universe?
View GitHub Profile
@supairish
supairish / gist:2951524
Created June 18, 2012 23:58
Nginx - how to limit requests by User Agent
http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
@whitingx
whitingx / meta-tags.md
Created October 5, 2012 16:41 — forked from kevinSuttle/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@bramus
bramus / .htaccess
Last active August 16, 2024 06:02
URL Rewriting for Apache (requires mod_rewrite) and IIS (requires IIS url rewrite module)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
@hartzis
hartzis / EventComponent.js
Last active November 29, 2023 16:38
Touch Event Handling React Component
import React from 'react';
export default class EventComponent extends React.Component {
constructor(props) {
super(props);
this._onTouchStart = this._onTouchStart.bind(this);
this._onTouchMove = this._onTouchMove.bind(this);
this._onTouchEnd = this._onTouchEnd.bind(this);
@bynil
bynil / config-git-proxy.txt
Last active September 20, 2024 18:22
Use git over socks5 proxy
Port: 1080
1. Create a file /YOUR PATH/gitproxy.sh with content:
#!/bin/sh
nc -X 5 -x 127.0.0.1:1080 "$@"
2. Edit your ~/.gitconfig
# For git://
@nyaapass
nyaapass / npmrc.taobao
Created January 17, 2018 01:42
使用淘宝源的 npmrc 配置文件
loglevel=http
progress=false
registry=https://registry.npm.taobao.org
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver/
@SoftCreatR
SoftCreatR / README.md
Last active April 25, 2021 11:24
ImageMagick® 7 for Debian/Ubuntu.

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode
@Aloxaf
Aloxaf / fcitx5-diagnose.sh
Created July 4, 2020 02:20
实验性的 fcitx-diagnose for fcitx5
#!/usr/bin/env bash
shopt -s extglob nullglob globstar
export TEXTDOMAIN=fcitx5
__test_bash_unicode() {
local magic_str='${1}'$'\xe4'$'\xb8'$'\x80'
local magic_replace=${magic_str//\$\{/$'\n'$\{}
! [ "${magic_str}" = "${magic_replace}" ]
}
@sindresorhus
sindresorhus / esm-package.md
Last active April 6, 2025 11:31
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.