This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gzip html, css and js | |
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript application/javascript | |
# far future expires headers | |
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"> | |
ExpiresDefault "access plus 10 years" | |
</FilesMatch> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Schema Information | |
# | |
# Table name: experiences | |
# | |
# id :integer(4) not null, primary key | |
# doctor_id :integer(4) | |
# place_of_practice :string(255) | |
# year_start :integer(4) | |
# year_end :integer(4) | |
# created_at :datetime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Usage: gemspec [-s] GEMNAME | |
# | |
# Prints a basic gemspec for GEMNAME based on your git-config info. | |
# If -s is passed, saves it as a GEMNAME.gemspec in the current | |
# directory. Otherwise prints to standard output. | |
# | |
# Once you check this gemspec into your project, releasing a new gem | |
# is dead simple: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Demo Everywhere</title> | |
</head> | |
<body> | |
<h1>hello world</h1> | |
<ul> | |
{% for msg in messages%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1: there is some hard code in the project like: | |
<% if false %> | |
Provided by <a href="http://recaptcha.net/" target="_blank">Recaptcha</a> | |
<% end %> | |
since the code wrap in the condition will never be execute, why not remove it . | |
2: maybe we can add fields into users for methods like "pending_count", so every time we load the information of user we don't need to join the friendships table. | |
3: we can move some big mail deliveries using background job (delayed_job etc.) , like InvitationMailer.deliver_invitations(@user, emails), since it will send couples of email out, it will lower the user experience to wait. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dragon; end | |
# 使用 def 定義 class method | |
Dragon.instance_eval do | |
def foo | |
puts "bar" | |
end | |
end | |
Dragon.foo # bar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hello(): | |
print "hello" | |
def hello2(): | |
print "hello2" | |
hello() | |
hello2() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: filehangar | |
version: live | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /remote_api | |
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py | |
login: admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "rubygems" | |
require "mutter" | |
require "httparty" | |
REMOTE = "origin" | |
REPO = `git config --get remote.#{REMOTE}.url`.chomp[/github\.com[\/\:](\w+\/\w+)\.git/, 1] | |
USER = `git config --get github.user`.chomp | |
TOKEN = `git config --get github.token`.chomp |