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
Argument Array | |
Collapse a list of arguments into an array. | |
Around Alias | |
Call the previous, aliased version of a method from a redefined method. | |
Blank Slate | |
Remove methods from an object to turn them into Ghost Methods. | |
Class Extension |
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
curl -H "Content-Typ"Authorization: OAuth O7KrMTwmw997iq0KzL7v" -d '{"messages":[{"body":"hello world!"}]}' "http://158.181.176.161:8080/3/projects/53a3b3bd5e8edd1245000005/queues/my_queue/messages" |
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
class GardenHose: | |
def countDead(self, n, rowDist, colDist, hoseDist): | |
count = 0 | |
for row in range(0, n): | |
for col in range(0, n): | |
if (row + 1) * rowDist <= hoseDist or (n - row) * rowDist <= hoseDist: | |
continue | |
if (col + 1) * colDist <= hoseDist or (n - col) * colDist <= hoseDist: | |
continue | |
count += 1 |
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
I just found another way to add GOPATH sources in the project. | |
1) Open Project Structure. | |
2) Select Project Settings -> Modules -> {your module} | |
3) Under sources label, select Add Content Root to add GOPATH folder. | |
4) Mark src folder in GOPATH folder as Sources. | |
Then the GOPATH is added to the project, and everything works fine. The plugin do not need to know anything about GOPATH. | |
I think it should works for non-IDEA IDEs. |
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') |
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
Hmm…it looks like I just wrote War and Peace |
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 -u postgres psql | |
postgres=# create user "guy_on_stackoverflow" with password 'keepitonthedl'; | |
postgres=# create database "dcaclab_development" owner "guy_on_stackoverflow"; |
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
<?php | |
/** | |
* Generate a DOCX file | |
* | |
* @category Phpdocx | |
* @package create | |
* @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L. | |
* (http://www.2mdc.com) | |
* @license LGPL |
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
$.fn.raty.defaults.path = "/assets"; | |
$.fn.raty.defaults.half_show = true; | |
$(function(){ | |
$(".star").raty({ | |
score: function(){ | |
return $(this).attr('data-rating') | |
}, | |
number: function() { | |
return $(this).attr('data-star-count') |
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
sunloverz@kg:~/projects/discourse$ vagrant box add discourse-0.8.4 ~/Downloads/discourse-0.8.4.box | |
Downloading or copying the box... | |
Extracting box...te: 27.6M/s, Estimated time remaining: 0:00:01) | |
Successfully added box 'discourse-0.8.4' with provider 'virtualbox'! | |
sunloverz@kg:~/projects/discourse$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Importing base box 'discourse-0.8.4'... | |
[default] Matching MAC address for NAT networking... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... |
OlderNewer