Skip to content

Instantly share code, notes, and snippets.

View brenopolanski's full-sized avatar
🦙
Llama Llama

Breno Polanski brenopolanski

🦙
Llama Llama
View GitHub Profile
@brenopolanski
brenopolanski / deleteObjectFunction.js
Created August 25, 2014 15:08
Delete object function
var obj = {
a: 'house',
b: function() {
console.log('Hi function');
},
c: 123456
}
deleteObjectFunction: function(obj) {
if (obj.length === undefined) {
@brenopolanski
brenopolanski / ClearFileInput.js
Created September 11, 2014 22:16
Clear a File Input
var inputFile = $("#control");
function something_happens() {
inputFile.replaceWith(inputFile.val('').clone(true));
};
@brenopolanski
brenopolanski / write-vim-sudo.md
Created September 22, 2014 13:06
Write vim file as superuser

If you find you do not have permission to perform :w, use the following:

:w !sudo tee % > /dev/null

@brenopolanski
brenopolanski / shell-comando-teste.md
Last active August 29, 2015 14:06
Shell - O comando test
Testes em variáveis
-lt Núm. é menor que (LessThan)
-gt Núm. é maior que (GreaterThan)
-le Núm. é menor igual (LessEqual)
-ge Núm. é maior igual (GreaterEqual)
-eq Núm. é igual (EQual)
-ne Núm. é diferente (NotEqual)
= String é igual
!= String é diferente
@brenopolanski
brenopolanski / truncate-string.md
Last active August 29, 2015 14:06
Truncate String with Ellipsis

via: css-tricks

.truncate {
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@brenopolanski
brenopolanski / bower-install-https.md
Created October 2, 2014 16:28
Bower install using only https
@brenopolanski
brenopolanski / update-time_by_day-year.md
Last active August 29, 2015 14:09
Update time_by_day year

on your local install go to http://localhost:8080/saiku/console

jdbc:h2:../../data/foodmart add that as a jdbc url and then run:

  • update "time_by_day" set "the_year" = 2014 where "the_year" = 1997;
  • update "time_by_day" set "the_year" = 2015 where "the_year" = 1998;
@brenopolanski
brenopolanski / mdx-days.md
Last active August 29, 2015 14:09
MDX Dates

Equals

Filter([Time].[Weekly].[Day].members, [Time].[Weekly].[Day].CurrentMember.Properties("date_string") = '1997/02/01')

After

Filter([Time].[Weekly].[Day].members, [Time].[Weekly].[Day].CurrentMember.Properties("date_string") > '1997/02/01')

Before

var test = function () {
SaikuUtils.create('http://localhost:8080/pentaho/plugin/saiku/api/').execute({
username: 'admin',
queryname: 'test123',
cube: {
schemaName: 'SteelWheels',
name: 'SteelWheelsSales',
},
mdx: 'SELECT NON EMPTY {Hierarchize({[Measures].[Quantity]})} ON COLUMNS, NON EMPTY {Hierarchize({[Product].[Product].Members})} ON ROWS FROM [SteelWheelsSales]',
@brenopolanski
brenopolanski / xbox360-erro-mtu.md
Last active August 29, 2015 14:11
X360 + GVT + D-Link DSL-2640B (erro MTU)

Add IP estático para o XBOX 360 e adicionar o endereço no DMZ Host.

Advanced Setup -> NAT -> DMZ Host -> DMZ Host IP Address

Depois reiniciar o router ✌️