Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
@flyfire
flyfire / bash_profile.sh
Created July 24, 2011 04:00 — forked from zhasm/bash_profile.sh
common alias
#!/bin/bash
export EDITOR='/usr/bin/vim'
export PS1="\[\e[36;1m\]\u\[\e[0m\]@\[\e[32;1m\]\h\[\e[0m\]:\[\e[31;1m\]\w\[\e[0m\]\n$"
alias a=alias
a grep="grep --color=auto -s"
#ls
layout title date comments categories
post
Installing Octopress (Fedora Version)
2012-02-05 06:13
true
fedora linux octopress ruby rvm jekyll rubygems

I (rather obviously) recently found myself attempting to install Octopress. Sure, it has great documentation, but some areas were lacking -- specifically, initial setup. As someone who has not worked with Ruby before other than a rather limited Windows install for a jekyll project, I had virtually no experience installing Ruby, using RVM, or even playing with RubyGems.

@flyfire
flyfire / Markdown.sublime-build
Created March 31, 2012 03:43 — forked from dvhthomas/Markdown.sublime-build
Pandoc powered Sublime Text 2 build provider for Markdown files: HTML the easy way
{
"cmd": ["pandoc.exe", "--to=html", "--output=$file.html", "$file"],
"selector": "source.md"
}
@flyfire
flyfire / fetch_by_name.rb
Created August 3, 2012 13:08 — forked from hooopo/fetch_by_name.rb
fetch_by_name
# -*- encoding : utf-8 -*-
module FetchByName
def fetch_by_name(name, field_name = :name)
if id = Rails.cache.read("cached_#{self.name}_#{field_name}_#{name}")
self.find(id)
else
record = self.where(field_name => name).first || raise(ActiveRecord::RecordNotFound)
record.tap{|record| Rails.cache.write("cached_#{self.name}_#{field_name}_#{name}", record.id)}
end
end
@flyfire
flyfire / antispam.py
Created August 22, 2012 13:00 — forked from zhasm/antispam.py
get unread Gmails, print the Subject, From, To, Message-ID, without modifying the gmails' flags.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import imaplib2 as imaplib
from email import Header
from email.parser import Parser
##USER CONFIG
HOST = 'imap.gmail.com'
@flyfire
flyfire / solarized-dark.xcs
Created October 8, 2013 10:50 — forked from clyfish/solarized-dark.xcs
Solarized Colorscheme for XShell
[Solarized Dark]
text(bold)=839496
magenta(bold)=6c71c4
text=839496
white(bold)=fdf6e3
green=859900
red(bold)=cb4b16
green(bold)=586e75
black(bold)=073642
red=dc322f
@flyfire
flyfire / README.md
Created November 13, 2013 04:37 — forked from oklai/README.md

TCTicketScript

TCTicketScript是一段浏览器脚本,帮你自动查询火车票余票。

如何使用

  1. 进入https://dynamic.12306.cn/otsweb/,注意必须从这个地址进入,忽略警告信息;
  2. 在页面设定好你的出发地、目的地与出发日期;
  3. 复制TCTicketScript.js中的代码;
  4. 打开浏览器调试工具控制台(F12),执行此代码。第一次会询问是否开启桌面提示功能,需同意。
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal

Bash Shell启动方式与rc脚本

Shell的不同分类

根据启动Bash Shell的方式不同,对Shell有两种分类方式

登录Shell与非登录Shell

根据Shell的启动方式不同,可以将Shell分为