Skip to content

Instantly share code, notes, and snippets.

@tioback
tioback / server.js
Created Jul 16, 2020
server.js for Pager interview
View server.js
// author Renato Back (renatopb@gmail.com)
const Hapi = require('hapi');
const MongoClient = require('mongodb').MongoClient;
const server = Hapi.server({
port: 3000,
debug: {
request: ['*']
}
@tioback
tioback / application-logger.decorator.ts
Created Jan 21, 2019
App Logger usando funções anônimas ao invés de arrow functions
View application-logger.decorator.ts
import * as _ from 'lodash';
import { FunctionLoggerOptions } from './interfaces';
import { defaultFunctionOptions } from './default-options';
import { logMessage } from './messages.helper';
export const logger = function (options = defaultFunctionOptions): Function {
return function(target: any, methodName: string, descriptor: any) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(target, methodName);
@tioback
tioback / PKZIP APPNOTE 6.3.4.
Created Feb 11, 2018 — forked from ross-spencer/PKZIP APPNOTE 6.3.4.
Unmodified copy of PKZIP Speciffication, source date: 1 November 2015: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
View PKZIP APPNOTE 6.3.4.
File: APPNOTE.TXT - .ZIP File Format Specification
Version: 6.3.4
Status: Final - replaces version 6.3.3
Revised: October 1, 2014
Copyright (c) 1989 - 2014 PKWARE Inc., All Rights Reserved.
1.0 Introduction
---------------
1.1 Purpose
View DeckCounter.java
package performer.oss.usecases.oss_014;
import java.util.*;
/**
* 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, K, A
The four suits are:
S - Spade (♠), C - Club(♣), H - Heart(♥), D - Diamond(♦)
@tioback
tioback / object-watch.js
Created Jun 23, 2017 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
View object-watch.js
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@tioback
tioback / object-watch.js
Created Jun 23, 2017 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
View object-watch.js
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
View Hackerrank - A Very Simple Multiple
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Pattern;
// https://www.hackerrank.com/challenges/a-very-special-multiple
public class AVerySpecialMultiple {
private static Pattern PATTERN = Pattern.compile("^(4+)(0*)$");
@tioback
tioback / idea-reset-evaluation.sh
Created Apr 18, 2017
reset intellij idea 14 evaluation
View idea-reset-evaluation.sh
#!/bin/bash
echo "removeing evaluation key"
rm ~/.IntelliJIdea15/config/eval/idea15.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea15/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
@tioback
tioback / Input with suggestions
Created Sep 26, 2016
Workaround for using zIndex with Android.
View Input with suggestions
import React, {Component} from "react";
import {
Dimensions,
Image,
Keyboard,
Modal,
Platform,
ScrollView,
StyleSheet,
Text,