Updated for Rails 4.0.0+
-
Set up the
bower
gem. -
Follow the Bower instructions and list your dependencies in your
bower.json
, e.g.// bower.json
{
apt-get install php5-mcrypt | |
mv -i /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/ | |
php5enmod mcrypt | |
service apache2 restart | |
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl | |
sudo service apache2 restart | |
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin master |
How to solve the curl port 443: Network is unreachable problem:
joridos@localhost:~/Documents/github$ opam init
default Downloading https://opam.ocaml.org/urls.txt
'opam init' failed.
# opam-version 1.1.1
# os linux
Cannot download https://opam.ocaml.org/urls.txt, please check your connection settings.
joridos@localhost:~/Documents/github$ curl https://opam.ocaml.org/urls.txt
How to generrate simple blog with rails engine: | |
```bash | |
$ rails plugin new blorgh --mountable | |
$ cd blorgh/ | |
$ rails generate scaffold article title:string text:text | |
``` | |
Add to gem file `gem 'blorgh', path: "/path/to/blorgh"` |
Test Credit Card Account Numbers:
American Express: 378282246310005
American Express: 371449635398431
American Express Corporate: 378734493671000
Australian BankCard: 5610591081018250
<?php | |
//display all keys in magento registry | |
$class = new ReflectionClass('Mage'); | |
$prop = $class->getProperty('_registry'); | |
$prop->setAccessible(true); | |
$registry = $prop->getValue(); | |
var_dump( | |
array_keys($registry) |
git checkout master | |
git checkout -b my-new-feature | |
git branch | |
git fetch -p | |
git reset --hard origin/homologa | |
git add . | |
git commit -m 'added html file in root path' | |
git push origin ON-3448 | |
git branch -v | |
git log # used for get the commit hash => 7e343cd7d399c39bcdc630e7ec84a200cc9a53d9 |
No desenvolvimento/discussão em um pull request é comum fazer commits extras para acertar detalhes de implementação, mudar a lógica de negócio ou até para melhorar os testes.
Quando o código está pronto para ser mergeado é interessante fazer no minímo o squash desses commits e gerar apenas um, para facilitar levantamento/estudo das razões que o desenvolver usou alguma gem/pattern para resolver certo problema e assim identificar soluções para problemas futuros gerados por decisões tomadas atualmente.
Uma vez que a branch esta X
commits a frente da master é necessário desfazer esses commits com o seguinte comando:
git reset HEAD~X --soft
Esse comando vai deixar todas as modificações referentes a todos os commits esperando apenas para um novo commit ser gerado: