Skip to content

Instantly share code, notes, and snippets.

View phuongnd08's full-sized avatar

Phuong Nguyen phuongnd08

  • Farmer
  • Ho Chi Minh City
View GitHub Profile
%div#here_you_see_capture_haml_still_output
- chat_entry_template = capture_haml do
.chat_entry
%a{:href => "{link}", :title => "{display_name}"}
%img{:src => "{avatar_url}"}
%span.msg {content}
- chat_error_template = capture_haml do
.chat_error {message}
<div id='here_you_see_capture_haml_still_output'>
<div class='chat_entry'>
<a href='{link}' title='{display_name}'>
<img src='{avatar_url}'>
</a>
<span class='msg'>{content}</span>
</div>
<div class='chat_error'>{message}</div>
<div class='chat_info'>{message}</div>
</div>
%li{"data-role" => "list-divider", :role => "heading", "data-theme" => "b"}
%a
Order Name
%span.ui-li-count= order.ordered_time
%a{ "data-icon" => "star", "data-theme" => "c", "data-remote" => "true", "data-method" => :put, :href => "/submit"} Ready
@phuongnd08
phuongnd08 / autocomplete_spec.rb
Created May 9, 2012 15:55
Testing the search
require 'spec_helper'
describe "matching partner movies using autocomplete", :js => true do
include_context "site_navigation"
let!(:movie1) { Factory(:movie, :title => "Mov #1") }
let!(:movie2) { Factory(:movie, :title => "Mov #2") }
let(:movies) { [movie1, movie2] }
let!(:partner_movie1) { Factory(:partner_movie, :movie => movie1) }
let!(:partner_movie2) { Factory(:partner_movie, :movie => nil) }
@phuongnd08
phuongnd08 / kienlanet
Created July 16, 2012 00:10
Deployment investigation
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 295 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
@phuongnd08
phuongnd08 / kienlanet
Created July 16, 2012 04:03
Deployment investigation
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 295 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
@phuongnd08
phuongnd08 / circle.yml
Created September 12, 2012 08:38
Deployment settings for sirinova on Circle CI
deployment:
production:
branch: master
heroku:
appname: sirinova-prod
commands:
- git push [email protected]:sirinova-prod.git
- heroku run rake db:migrate
- heroku restart
@phuongnd08
phuongnd08 / link.txt
Created November 9, 2012 03:30
Url checkout ngan luong
@phuongnd08
phuongnd08 / initd_redis
Created May 7, 2014 09:34
Redis init script for CentOS
#!/bin/sh
#
# redis init file for starting up the redis daemon
#
# chkconfig: - 20 80
# description: Starts and stops the redis daemon.
# Source function library.
. /etc/rc.d/init.d/functions
@phuongnd08
phuongnd08 / calculate_execution_time.rb
Created October 14, 2014 10:04
Circle CI parallelism execution time
container0 = <<-STR
Starting the build00:00
Start container (0)00:02config
checkout
Restore source cache00:03cache
Checkout using deploy key 00:07config
machine
Configure the build00:00cache
Restore cache00:19cache
dependencies