Skip to content

Instantly share code, notes, and snippets.

View Baozi2's full-sized avatar
💭
I may be slow to respond.

zouyu1026 Baozi2

💭
I may be slow to respond.
View GitHub Profile
@kinopyo
kinopyo / gist:2426829
Created April 20, 2012 07:23
Ruby: Get module name or class name without module
n = Notification::Answer.new
n.class.name.split('::').last || ''
# => "Answer"
n.class.name.split('::').first || ''
# => "Notification"
@quexer
quexer / jQuery-plugin-authoring.md
Created September 4, 2012 09:42
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始

@jugyo
jugyo / nginx.conf
Created September 27, 2012 09:02
nginx.conf to switch proxy for mobile
http {
upstream app-pc {
server 127.0.0.1:8001;
}
upstream app-mobile {
server 127.0.0.1:8002;
}
server {
@dannguyen
dannguyen / gist:6595597
Last active January 18, 2019 17:49
Running rails engine with rspec
# http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl
rails plugin new my_engine --dummy-path=spec/dummy --skip-test-unit --mountable
# or, the full monty:
rails plugin new active_scraper --mountable --dummy-path=spec/dummy --skip-test-unit --skip-javascript --skip-sprockets --skip-action-view
# https://github.com/rspec/rspec-rails
rails generate rspec:install
@yisibl
yisibl / git-branch.md
Last active September 13, 2024 08:59
在Mac、Linux 终端显示 Git 当前所在分支

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

  1. 进入你的home目录
cd ~
  1. 编辑.bashrc文件
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 18, 2024 11:51
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@IzumiSy
IzumiSy / manifest.json
Last active August 16, 2024 05:25
Chrome.storage.sync example
{
"name": "SyncExtension",
"version": "0.1",
"manifest_version": 2,
"description": "Storage Sync Extension",
"permissions": [ "storage" ],
"browser_action": {
@v5tech
v5tech / jenv.md
Created September 15, 2014 03:43
Mac下同时安装多个版本的JDK

Mac下同时安装多个版本的JDK

Mac自带了的JDK6,安装在目录:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/下。

JDK7,JDK8则需要自己到Oracle官网下载安装对应的版本。自己安装的JDK默认路径为:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk

1. 在用户目录下的bash配置文件.bashrc中配置JAVA_HOME的路径:

export JAVA_6_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
@ifels
ifels / centos6.5_nginx
Last active September 7, 2023 01:57
centos 6.5 nginx安装与配置
第一步,在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo:
cd /etc/yum.repos.d/
vim nginx.repo
填写如下内容:
[nginx]
name=nginx repo
@mRoca
mRoca / git_flow.md
Last active November 6, 2020 17:10
Git flow

Naming convention

Item Name
Release branch release/v2.0.1
Feature branch feature/my_feature_name
Feature branch feature/2234_my_feature_name
Hotfix branch hotfix/my_hotfix_name
Commit Add my news
Tag v2.0.1