This file contains 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
@posts = @posts1 + @posts2 | |
#Descending | |
@posts.sort! {|x,y| y.created_at <=> x.created_at} | |
#Ascending | |
@posts.sort! {|x,y| x.created_at <=> y.created_at} |
This file contains 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
git fetch origin | |
git checkout develop | |
git reset --hard origin/develop |
This file contains 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
.no-sort::after { display: none!important; } | |
.no-sort { pointer-events: none!important; cursor: default!important; } | |
<th class="no-sort">Heading</th> |
This file contains 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. Package the pre-configured box => vagrant package --base preconfigured_vm --output /path/to/mybox.box. Note that as per the docs, the --base option should be the UUID of the machine, or the name VirtualBox gives the machine (found when opening the VirtualBox application). | |
2. transfer the box to the computer by using scp, rsync or whatever... (you also start a web server quickly by using python -m http.server PORT or ruby -run -e httpd /path/to -p PORT) | |
3. Init and start vagrant init preconfigured_vm /path/to/mybox.box |
This file contains 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
change_column :table, :column, 'integer USING CAST(column AS integer)' |
This file contains 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
rails g active_record:migration |
This file contains 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
[global] | |
map archive = no | |
http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#MAPARCHIVE |
This file contains 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
/** @jsx React.DOM */ | |
var LopMonHoc = React.createClass({ | |
getInitialState: function(){ | |
return {data: []} | |
}, | |
loadData: function(){ | |
$.ajax({ | |
url: '/daotao/lops', | |
success: function(data){ |
This file contains 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
sudo apt-get install libmysqlclient-dev | |
sudo apt-get install libsphinxclient-dev | |
Get the tar | |
Configure the source code: ./configure –prefix=/usr/local | |
Run: make | |
Run: sudo make install | |
sudo pear install pecl/sphinx |
This file contains 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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |