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
<h2>RECENT POSTS</h2> | |
<ol> | |
<% blog.articles[0...10].each do |article| %> | |
<li><%= link_to article.title, article %> <span><%= article.date.strftime('%b %e') %></span></li> | |
<% end %> | |
</ol> |
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
<h2>ARCHIVE</h2> | |
<ol> | |
<% blog.articles.group_by {|a| a.date.year }.each do |year, articles| %> | |
<li><%= link_to year, blog_year_path(year) %></li> | |
<% end %> | |
</ol> |
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 add-apt-repository ppa:webupd8team/sublime-text-3 | |
sudo apt-get update | |
sudo apt-get install sublime-text-installer |
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
for (Map.Entry<String, String> entry : map.entrySet()) | |
{ | |
System.out.println(entry.getKey() + "/" + entry.getValue()); | |
} |
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
public static int abs(int value){ | |
int mask = value>>31; | |
return (value ^ mask) - mask; | |
} |
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
private static int[] radixSort(int[] unsortedArr, int digits){ | |
for(int i = 1; i <= digits; ++i){ | |
unsortedArr = countSort(unsortedArr, 10, (int)Math.pow(10, i)); | |
} | |
return unsortedArr; | |
} | |
private static int[] countSort(int[] unsortedArr, int base, int digit){ | |
int[] keyArray = new int[base]; | |
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
for(long long int temp = number; temp >= 1;) | |
{ | |
temp/=10; | |
decimalPlaces++; | |
} |
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
find . -name "NAME" -print0 | xargs -0 rm -rf |
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
import random | |
import string | |
def rand_string(length): | |
return ''.join(random.choice(string.printable) for x in range(length)) | |
print rand_string(64) |
OlderNewer