To create a ReactComponent:
ReactComponent React.createClass(object proto)
Basic JSX example:
var TitleComponent = React.createClass({
// REQUIRED
| upstream puma { | |
| server unix:///var/www/app/shared/tmp/sockets/puma.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80 default deferred; | |
| server_name example.com; | |
| rewrite ^/(.+) https://example.com/$1 permanent; | |
| } |
| #!/usr/bin/env ruby | |
| require 'mail' | |
| mysql_username = 'root' | |
| mysql_password = '123456' | |
| mysql_database = 'test' | |
| system("mysqldump --user=#{mysql_username} --password=#{mysql_password} #{mysql_database} > backup.sql") | |
| # Credit to : |
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| # Este arquivo deve ser colocado em config/locales/devise.pt-BR.yml | |
| pt-BR: | |
| devise: | |
| confirmations: | |
| confirmed: "Sua conta foi confirmada com sucesso." | |
| send_instructions: "Você receberá um email para confirmar sua conta em alguns minutis." | |
| send_paranoid_instructions: "Caso seu endereço de email já exista em nossa base, você receberá um email com instruções sobre como ativar sua conta." | |
| failure: |
I was asked how I deal with validation / create and update validation rulesets. Well here is one method I have used. Don't be afraid to build on top of what the framework has already given you. In my projects I use a base class for almost anything. You never know when you want your classes to inherit some common functionality. My BaseValidator actually has some pretty useful methods and properties in it.
<?php
namespace FooProject\Internal\Validators;
use FooProject\Internal\Sanitizers\BaseSanitizer;Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node
Important: your node location may vary. Use which node to find it, or use it directly in the command:
| <textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea> | |
| ... | |
| <textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea> | |
| ... | |
| <script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script> | |
| <script> | |
| // Hook up ACE editor to all textareas with data-editor attribute | |
| $(function () { |
The [RFC for a new simple to use password hashing API][rfc] has just been accepted for PHP 5.5. As the RFC itself is rather technical and most of the sample codes are something you should not use, I want to give a very quick overview of the new API:
Everybody knows that you should be hashing their passwords using bcrypt, but still a surprising number of developers uses insecure md5 or sha1 hashes (just look at the recent password leaks). One of the reasons for this is that the crypt() API is ridiculously hard to use and very prone to programming mistakes.
| # encoding: utf-8 | |
| # Be sure to restart your server when you modify this file. | |
| # Add new inflection rules using the following format | |
| # (all these examples are active by default): | |
| # ActiveSupport::Inflector.inflections do |inflect| | |
| # inflect.plural /^(ox)$/i, '\1en' | |
| # inflect.singular /^(ox)en/i, '\1' | |
| # inflect.irregular 'person', 'people' | |
| # inflect.uncountable %w( fish sheep ) |
| git config --global user.name "Tarcisio Coutinho" | |
| git config --global user.email "tcs5cin@gmail.com" | |
| git config --global color.ui true | |
| git config --global alias.s status | |
| git config --global alias.c checkout | |
| git config --global alias.b branch | |
| git config --global alias.lol log --oneline --graph --decorate |