This file contains hidden or 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
| $.extend(Pizza, { | |
| line : function (legend) { | |
| var settings = legend.data('settings'), | |
| svg = this.svg(legend, settings), | |
| container = $(this.identifier(legend)), | |
| width = container.outerWidth(), | |
| height = container.outerHeight(), | |
| data = legend.data('graph-data'), | |
| max_x = max_y = min_x = min_y = total_x = total_y = 0, | |
| i = data.length, |
This file contains hidden or 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
| mysql> show table status; | |
| ``` | |
| +----------+--------+-------------------+ .. | |
| | Name | Engine | Collation | .. | |
| +----------+--------+-------------------+ .. | |
| | my_table | InnoDB | latin1_swedish_ci | .. | |
| ``` | |
| Therefore I altered the character set of the table directly: |
This file contains hidden or 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
| <ul class="large-block-grid-7"> | |
| <% month = (params[:month] || Date.today.month).to_i %> | |
| <% first_day_of_week = DateTime.new(2014, month, 01).strftime('%w').to_i.times.each do |i| %> | |
| <li>blank</li> | |
| <% end %> | |
| <% Time.days_in_month(month, 2014).times.each do |i| %> | |
| <li><%= Date.new(2014, month, 01) + i.day %> | |
| <% end %> | |
| </ul> |
This file contains hidden or 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
| names = [] | |
| @topics.each do |topic| | |
| names << topic.name | |
| end | |
| names | |
| names = @topics.map do |topic| | |
| topic.name | |
| end |
This file contains hidden or 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
| <iframe src="//fast.wistia.net/embed/iframe/qnr7gv5l8i?videoFoam=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width="720" height="405"></iframe><script src="//fast.wistia.net/assets/external/iframe-api-v1.js"></script> |
This file contains hidden or 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 /path/to/files* -mtime +5 -exec rm {} \; | |
| # five represents the number of days. |
This file contains hidden or 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') |
This file contains hidden or 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 math | |
| import Image | |
| import Levenshtein | |
| class BWImageCompare(object): | |
| """Compares two images (b/w).""" | |
| _pixel = 255 |
This file contains hidden or 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 branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d | |
| or | |
| git branch --merged master | grep -v 'master$' | xargs git branch -d |
This file contains hidden or 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 pbcopy(input) | |
| str = input.to_s | |
| IO.popen('pbcopy', 'w') { |f| f << str } | |
| str | |
| end | |
| def pbpaste | |
| `pbpaste` | |
| end |