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
<a href="javascript:void(0)" class="toggleLink" data-mid="<%= message.id %>">Link to my partial</a> | |
<div id="add_comment<%=message.id%>" style="display:none"> | |
Comment box | |
</div> |
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
[alias] | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative | |
#git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" |
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 python-software-properties | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs |
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 cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |
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
require 'resque/tasks' | |
namespace :ns do | |
desc "test task accepts param" | |
task :task, [:param] => [:environment] do |t,args| | |
abort "Please specify a param!" unless args[:param] | |
puts args[:param] | |
end | |
end |
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
<?xml version="1.0"?> | |
<root> | |
<devicevendordef> | |
<vendorname>PFU</vendorname> | |
<vendorid>0x0853</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>HHK</productname> |
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
$ date | |
Sun Mar 10 12:50:37 EDT 2013 | |
$ more /etc/timezone | |
America/Toronto | |
$ sudo dpkg-reconfigure tzdata | |
$ sudo service cron stop |
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
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |
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
def find_max_subarray(array) | |
max_sum = current_sum = current_start = start_idx = end_idx = cursor = 0 | |
while cursor < array.length | |
current_test = current_sum + array[cursor] | |
if current_test > 0 | |
if current_sum == 0 | |
current_start = cursor | |
end | |
current_sum += array[cursor] |
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
def find_max_subarray(array) | |
#initialize all variables to zero | |
max_sum = current_sum = current_start = start_idx = end_idx = cursor = 0 | |
# Go through individual element | |
for cursor in 0...array.length | |
# current_sum is the previous sum plus current element | |
current_sum += array[cursor] | |
if current_sum > max_sum # the case where the current sum is greater than the best sum so far. | |
# we set best sum so far to current sum |
OlderNewer