Skip to content

Instantly share code, notes, and snippets.

View rruffer's full-sized avatar

Rodolfo Ruffer rruffer

  • VALID
  • Duque de Caxias - RJ
View GitHub Profile
@sjimenez44
sjimenez44 / TimeZone.md
Created September 8, 2021 19:19
Change time zone Docker container

Change TimeZone in Docker containers

With Docker Engine

The timezone of a container can be set using an environment variable in the docker container when it is created. For example:

$ docker run ubuntu:latest date
Sat Feb 27 15:58:32 UTC 2021
$ docker run -e TZ=America/Bogota ubuntu:latest date
Sat Feb 27 15:58:40 Asia 2021
@cardil
cardil / JEP.md
Last active September 12, 2025 17:54
[Draft] JEP - Change name of imported type (aliasing)

Summary

Change name of imported type (aliasing)

Goals

The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

@kaleai
kaleai / HttpManager.java
Last active October 28, 2019 02:36
SonarDemo
public class HttpManager {
private static final String TAG = "HttpManager";
private static HttpManager mInstance = null;
private OkHttpClient httpClient;
public static HttpManager getInstance() {
if (mInstance == null) {
@dfa1234
dfa1234 / ngx-indexeddb.ts
Last active June 13, 2020 19:19
Indexed DB usable in Angular
export class AngularIndexedDB {
utils: Utils;
dbWrapper: DbWrapper;
constructor(dbName: string, version: number) {
this.utils = new Utils();
this.dbWrapper = new DbWrapper(dbName, version);
}
openDatabase(version: number, upgradeCallback?: Function) {
@pimatco
pimatco / all-angular-material-components-imports.txt
Last active September 17, 2024 21:54
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';
@florina-muntenescu
florina-muntenescu / BaseDao.kt
Last active January 1, 2025 06:52
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@SKempin
SKempin / Git Subtree basics.md
Last active October 1, 2025 17:53
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@jachanga
jachanga / MultipartFormDataInputToMultipartFormDataOutput.java
Created January 9, 2017 15:28
RestEasy MultipartFormDataInput to MultipartFormDataOutput
private MultipartFormDataOutput fromFormDataInputToFormDataOutput(MultipartFormDataInput input) {
MultipartFormDataOutput mdo = new MultipartFormDataOutput();
int i = 0;
for (Entry < String, List < InputPart >> inputPartEntry: input.getFormDataMap().entrySet()) {
String partId = inputPartEntry.getKey();
partId = partId.replaceAll("[^a-z,A-Z]", ""); //remove number al final
List < InputPart > inputParts = inputPartEntry.getValue();
for (InputPart part: inputParts) {
MultivaluedMap < String, String > headers = part.getHeaders();
@aelkz
aelkz / pom.xml
Created November 23, 2016 01:31
JSF 2 (primefaces) + Wildfly 10 + CDI configuration (pre-built maven pom.xml)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.aelkz</groupId>
<artifactId>JSFCDIWildlfyDemo</artifactId>
<version>1.0-SNAPSHOT</version>
@bmaupin
bmaupin / log4j2.xml
Last active November 15, 2024 11:11
Log4j2.xml for Tomcat
<?xml version="1.0" encoding="utf-8"?>
<Configuration status="info">
<Properties>
<Property name="logdir">${sys:catalina.base}/logs</Property>
<Property name="layout">%d [%t] %-5p %c- %m%n</Property>
</Properties>
<Appenders>
<Console name="CONSOLE" target="SYSTEM_OUT">
<PatternLayout pattern="${layout}"/>
</Console>