Skip to content

Instantly share code, notes, and snippets.

View tonyxu-io's full-sized avatar
😀
Busy?

Tony Xu tonyxu-io

😀
Busy?
View GitHub Profile
@tonyxu-io
tonyxu-io / awesome-cheat-sheets.md
Last active June 25, 2018 03:19
Awesome Cheat Sheets #cheatsheet
@tonyxu-io
tonyxu-io / copy-ssh-key-to-remote.md
Last active February 18, 2020 00:28
Terminal Commands

Copy SSH Key to Remote Server

Use ssh-copy-id

ssh-copy-id [-i identity file] [-p port] [user@]hostname
@tonyxu-io
tonyxu-io / index.html
Last active June 25, 2018 03:19
postMessage sample code #snippet
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
<button onclick="openWindow()">Open Window</button>
<script type="text/javascript">
function openWindow(){
window.open ("popup.html","popup", "width=350,height=250");
window.addEventListener(
@tonyxu-io
tonyxu-io / git-cheat-sheet.md
Last active June 25, 2018 03:20
Git Cheat Sheet #cheatsheet
@tonyxu-io
tonyxu-io / mac-terminal-cheat-sheet.md
Last active June 25, 2018 03:20
Mac Terminal Cheatsheet #cheatsheet

Mac Terminal Cheat Sheet

SHORTCUTS

Key/Command Description
Ctrl + A Go to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception
Ctrl + E Go to the end of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception
Ctrl + Q Clears everything on current line
Ctrl + L Clears the Screen
@tonyxu-io
tonyxu-io / sublime-text-cheat-sheet.md
Last active June 25, 2018 03:19
Sublime Text Cheat Sheet #cheatsheet

Sublime快捷键之Mac

备注:具体符号对应的按键

  • ⌘ Command key
  • ⌃ Control key
  • ⌥ Option key
  • ⇧ Shift Key

为了方便大家记忆,将快捷键分成了8个类型, 分别为

@tonyxu-io
tonyxu-io / vi-cheat-sheet.md
Last active June 25, 2018 03:19
VIM Cheat Sheet #cheatsheet

Cursor movement

h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)

e - jump to end of words (punctuation considered words)

@tonyxu-io
tonyxu-io / rest-api-sample-javascript.js
Last active June 25, 2018 03:19
REST API Call Sample Code #snippet
// Vanilla JS - GET
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://reqres.in/api/users', true);
xhr.onload = function () {
console.log(xhr.responseText)
};
xhr.send(null);
// Vanilla JS - POST
var xhr = new XMLHttpRequest();
@tonyxu-io
tonyxu-io / google-oauth-login.html
Last active November 5, 2019 08:00
Google OAuth #snippet
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
<button onclick="openWindow()">Login</button>
<pre id="access_token"></pre>
<pre id="tokenInfo"></pre>
<pre id="userInfo"></pre>
@tonyxu-io
tonyxu-io / linedin-login-sample-code.html
Last active August 8, 2020 13:23
Linkedin Login Sample Code #snippet
<!DOCTYPE html>
<html>
<head>
<title>Linkedin Demo</title>
<meta charset="utf-8">
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 86012 cynxvvidr
onLoad: checkAuthentication
authorize: true