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
| # Filter payment methods in Spree depending on the shipping name, | |
| # use the following snippet within your activation method to | |
| # make it work: | |
| # | |
| # CheckoutsController.class_eval { include FilterPaymentMethods } | |
| # | |
| # The magic happens within the InstanceMethods module, change the | |
| # regexp to fit your needs. | |
| # | |
| # Kai Krakow, http://github.com/kakra |
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
| rspec spec --format nested. |
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
| local to remote | |
| scp -i ~/.ssh/supernomads.pem supernomads.com.crt [email protected]:~/. | |
| ~/.ssh klasöründeyken | |
| rsync -avL --progress -e "ssh -i ./supernomads.pem" ~/Downloads/kibo_image/* [email protected]:/tmp/. | |
| rsync -rave "ssh -i ./supernomads.pem" ~/Downloads/kibo_image/* [email protected]:/tmp/. | |
| remote to local | |
| scp -r [email protected]:/path/to/foo /home/user/Desktop/ |
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
| sunucu restart | |
| sudo /etc/init.d/apache2 restart | |
| domain | |
| cd /etc/apache2/sites-available/ | |
| sudo a2dissite default | |
| sudo a2ensite xxxxx.com |
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
| You can use sprintf-like formatting to inject values into the string. For that the string must include placeholders. Put your arguments into an array and use on of these ways: (For more info look at the documentation for Kernel::sprintf.) | |
| fmt = 'The %s %s the %s' | |
| res = fmt % [animal, action, other_animal] # using %-operator | |
| res = sprintf(fmt, animal, action, other_animal) # call Kernel.sprintf | |
| You can even explicitly specify the argument number and shuffle them around: | |
| 'The %3$s %2$s the %1$s' % ['cat', 'eats', 'mouse'] | |
| Or specify the argument using hash keys: |
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
| How to turn off the iMac display | |
| CONTROL + SHIFT + EJECT |
NewerOlder