Skip to content

Instantly share code, notes, and snippets.

@nguyenlocduy
nguyenlocduy / index.html
Created November 13, 2010 08:30
a bare bone for html files
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
</head>
<body>
</body>
@nguyenlocduy
nguyenlocduy / style.css
Created November 13, 2010 08:31
CSS reset and starter file
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit;}
table {border-collapse: collapse; border-spacing: 0;}
caption, th, td {text-align: left; font-weight: normal;}
form legend {display: none;}
blockquote:before, blockquote:after, q:before, q:after {content: "";}
blockquote, q {quotes: "" "";}
ol, ul {list-style: none;}
hr {display: none; visibility: hidden;}
@nguyenlocduy
nguyenlocduy / .gitignore
Created January 3, 2011 11:10
Git Ignore Settings File
# OS generated files #
######################
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
# Compiled source #
###################
*.com
@nguyenlocduy
nguyenlocduy / virtualhost.conf
Created January 13, 2011 19:01
A template for Debian/Ubuntu Apache Virtual Host Conf
<VirtualHost *:80>
# don't loose time with IP address lookups
HostnameLookups Off
# configures the footer on server-generated documents
ServerSignature On
# the email adress of the administrator
ServerAdmin info@domain.tld
# Servername and aliases
import os
from fabric.api import env, run, prompt, local, get
from fabric.state import output
env.environment = ""
env.hosts = ["example.com"]
env.user = "admin"
env.full = False
output['running'] = False

Django Enviroment Setup on Mac OSX 10.6.2 (Snow Leopard)

Install Homebrew

sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init
@nguyenlocduy
nguyenlocduy / com.user.nginx.plist
Created February 6, 2011 15:45
Script to run Nginx at startup (MacOS)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>com.duy.nginx</string>
<key>OnDemand</key>
<false/>
@nguyenlocduy
nguyenlocduy / active_admin_views_pages_base.rb
Created June 12, 2012 05:53 — forked from jocubeit/active_admin_views_pages_base.rb
Override footer content in Active Admin gem
# lib/active_admin_views_pages_base.rb
class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
private
# Renders the content for the footer
def build_footer
div :id => "footer" do
para "Copyright &copy; #{Date.today.year.to_s} #{link_to('Example.com', 'http://example.com')}. Powered by #{link_to('Active Admin', 'http://www.activeadmin.info')} #{ActiveAdmin::VERSION}".html_safe
class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :login, :password, :password_confirmation, :remember_me
attr_accessor :login
@nguyenlocduy
nguyenlocduy / gist:3020001
Created June 29, 2012 19:06 — forked from chebyte/gist:1154889
Guide for configure Tomcat6, Solr 1.4, Sunspot for Rails Application on Ubuntu 8.04 or 10.04

Guide for configure Tomcat6, Solr 1.4, Sunspot for Rails Application on Ubuntu 8.04 or 10.04

1. Install the Java JRE and Ant

for ubuntu 8.04

add the following sources to /etc/apt/sources.list

deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse