Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:

Pedro Nauck pedronauck

:electron:
View GitHub Profile
@pedronauck
pedronauck / conventions.md
Created Aug 27, 2015
Development work convetions
View conventions.md

Convenções para Git

Principal Convenção: todos as mensagens referente a qualquer ação dentro do versionamento deverá ser feita em Inglês, seguindo as próximas convenções.

Razão: Inglês é a lingua internacional. Um dia você pode acabar desenvolvendo junto com a algum developer de outro país, escrever em uma linguagem universal ajudaria muito nessa situação.

Commits

  • Mensagens de commit devem ser escritos sempre no imperativa, nunca usar uma mensagem escrita no passado ou no presente.
  • Devem ser escrito apenas com lowercase.
View regex.md

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
View sublime_text_2.md

Sublime Text 2 Cheat Sheet

Edit

Command Description
CMD+SHIFT+V Paste and indent
CMD+] Indent
CMD+[ Unindent
CMD+CTRL+Arrow Up Swap line up
@pedronauck
pedronauck / Posts.jsx
Last active Aug 29, 2015
A simple structure example to use React with a router
View Posts.jsx
/* file path: ./views/Posts */
'use strict';
var React = require('react');
var PostIndex = React.createClass({
render: function() {
var posts = this.props.posts.map(function(post, index) {
return (
@pedronauck
pedronauck / react-todo-app.jsx
Last active Aug 29, 2015
Sample React todo app without LinkState()
View react-todo-app.jsx
/** @jsx React.DOM */
var TodoAdd = React.createClass({displayName: 'TodoAdd',
getInitialState: function() {
return { text: '' };
},
changeText: function(e) {
this.setState({ text: e.target.value });
e.preventDefault();
},
@pedronauck
pedronauck / average-sum.js
Last active Aug 29, 2015
Example of matrix manipulate with ES6
View average-sum.js
/*
* Function that calculate the average of a number
*
* @param {Number} num
* @param {Number} divisor
* @return {Number} simple arithmetic average of num
*
*/
var calcAverage = (num, divisor) => (num / divisor).toFixed(2);
View _compass-retina-sprites.scss
@mixin all-retina-sprites($map, $map2x) {
@media (min--moz-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
(-webkit-min-device-pixel-ratio: 1.5),
(min-device-pixel-ratio: 1.5),
(min-resolution: 1.5dppx) {
$base-class: sprite-map-name($map);
.#{$base-class}-all-retina-sprites {
@pedronauck
pedronauck / enquire.js
Created May 16, 2013
EnquireJS base script
View enquire.js
var query_960 = 'screen and (min-width: 45em)';
enquire.register($query_960, {
deferSetup : true,
setup : function() {
// load content via AJAX
},
match : function() {
// show sidebar
View Gruntfile.js
module.exports = function(grunt) {
var config = {};
// Set all the tasks you want to load.
var tasks = [
, "grunt-contrib-concat"
, "grunt-contrib-uglify"
, "grunt-contrib-jshint"
, "grunt-contrib-watch"
];
View grunt_plugins.md
You can’t perform that action at this time.