Skip to content

Instantly share code, notes, and snippets.

View xiongchengqing's full-sized avatar
🇨🇳
Never stop learning

Xiong,Cheng-Qing xiongchengqing

🇨🇳
Never stop learning
View GitHub Profile
@steveruizok
steveruizok / mapValues.ts
Created October 11, 2020 21:05
Map values.
export function remap<P, T>(
obj: { [key: string]: T },
fn: (value: T, index: number) => P
): { [key: string]: P } {
return Object.fromEntries(
Object.entries(obj).map(([id, value], index) => [id, fn(value, index)])
)
}
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@jjnilton
jjnilton / mac-network-commands-cheat-sheet.md
Last active April 28, 2024 23:25
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@ufologist
ufologist / autoplay-audio-ios.html
Created December 3, 2015 03:55
在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title>
</head>
<body>
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1>
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p>
@squarism
squarism / iterm2.md
Last active May 1, 2024 15:40
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@dexteryy
dexteryy / standards_for_webapps_on_mobile.md
Last active August 17, 2017 02:16
W3C Standards for Web Apps on Mobile (After HTML5)
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@awidegreen
awidegreen / vim_cheatsheet.md
Last active April 30, 2024 16:14
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 1, 2024 03:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname