Skip to content

Instantly share code, notes, and snippets.

View mreis1's full-sized avatar

Reis mreis1

View GitHub Profile
http://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
Column type Storage required
DATE 3 bytes
DATETIME 8 bytes
TIMESTAMP 4 bytes
TIME 3 bytes
YEAR 1 byte
http://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
Column type Storage required
DATE 3 bytes
DATETIME 8 bytes
TIMESTAMP 4 bytes
TIME 3 bytes
YEAR 1 byte
@mreis1
mreis1 / controller.js
Created March 30, 2016 17:33 — forked from BobNisco/controller.js
onLongPress AngularJS Directive - Great for mobile!
// Somewhere in your controllers for this given example
// Example functions
$scope.itemOnLongPress = function(id) {
console.log('Long press');
}
$scope.itemOnTouchEnd = function(id) {
console.log('Touch end');
}
@mreis1
mreis1 / tsconfig.json
Created June 22, 2016 20:48
Webpack Configuration
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
@mreis1
mreis1 / grunt-flag-parser.js
Last active August 23, 2016 07:10
grunt-flag-parser
var _ = require('lodash');
/***
*
* parser used to work with http://gruntjs.com/api/grunt.option
*
*
* Author marcio.reis@outlook.com
*
* - supports boolean params
@mreis1
mreis1 / 00100-Glossary.md
Last active November 14, 2016 13:22
web-reference

#Glossary

  • LC-{PERIOD} Last commit on {PERIOD}
  • LS Low Support
//converts a $color into a contrast color
@function mr-smart-contrast($color) {
@if (lightness($color) > 50) {
@return rgba(0,0,0,0.9); // Lighter backgorund, return dark color
} @else {
@return rgba(255,255,255,0.9); // Darker background, return light color
}
}
@mreis1
mreis1 / blog-webpack-2.md
Created November 23, 2016 19:49 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

@mreis1
mreis1 / nginx-template-docker-gen
Last active March 28, 2017 16:39
nginx-configuration-samples
docker-gen is able to generate a nginx configuration
https://github.com/jwilder/docker-gen/blob/master/templates/nginx.tmpl
@mreis1
mreis1 / json-parsing-in-java.txt
Last active November 30, 2016 00:23
Java Materials
//import these libraries
import java.util.ArrayList;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;