Skip to content

Instantly share code, notes, and snippets.

View ghostcode's full-sized avatar
🎯
Focusing

蝎子 ghostcode

🎯
Focusing
  • SH,China
View GitHub Profile

在Mac、Linux 终端显示 Git 当前所在分支

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
@ghostcode
ghostcode / 提问的智慧.md
Created May 17, 2018 16:18 — forked from zer4tul/提问的智慧.md
Simplified Chinese edition of "How To Ask Questions The Smart Way"
@ghostcode
ghostcode / publickey-git-error.markdown
Created April 8, 2017 14:23 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "[email protected]". Th
@ghostcode
ghostcode / sample-nginx.conf
Created January 7, 2017 14:54 — forked from dimitardanailov/sample-nginx.conf
Configuration for single page application(Framework: Angularjs, Web server: Nginx)
server {
listen 80 default deferred;
server_name myapp.com;
root /var/www/project-folder/;
# Nginx and Angularjs with html mode 5 - https://gist.github.com/cjus/b46a243ba610661a7efb
index index.html;
@ghostcode
ghostcode / sample-nginx.conf
Created January 7, 2017 14:54 — forked from cjus/sample-nginx.conf
AngularJS Nginx and html5Mode
server {
server_name yoursite.com;
root /usr/share/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
@ghostcode
ghostcode / index.jade
Created November 22, 2016 05:23
Material Navigation Pure CSS
form
input(type='radio' name='tab')#menu
.container
input(type='radio' name='tab' checked)#home
section.home
h1 Home
label(for='home')
input(type='radio' name='tab')#about
section.about
h1 About
@ghostcode
ghostcode / .gitignore
Created November 21, 2016 06:45 — forked from smebberson/.gitignore
Express simple authentication example
node_modules
*.swp
@ghostcode
ghostcode / visibly.js
Created November 18, 2016 02:51 — forked from addyosmani/visibly.js
Cross-browser Page Visibility API polyfill
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,
@ghostcode
ghostcode / meta-tags.md
Created September 7, 2016 03:56 — forked from kevinSuttle/meta-tags.md
List of Usable HTML Meta and Link 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'>
@ghostcode
ghostcode / compare.js
Created June 20, 2016 03:16 — forked from alexey-bass/compare.js
JavaScript version compare
/**
* Simply compares two string version values.
*
* Example:
* versionCompare('1.1', '1.2') => -1
* versionCompare('1.1', '1.1') => 0
* versionCompare('1.2', '1.1') => 1
* versionCompare('2.23.3', '2.22.3') => 1
*
* Returns: