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
@rruffer
rruffer / TimeZone.md
Created August 15, 2022 23:41 — forked from sjimenez44/TimeZone.md
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
@rruffer
rruffer / WSL 2 GNOME Desktop.md
Created April 26, 2021 15:25
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure out how [to](https://www.reddit.

@rruffer
rruffer / AsynchronousSocketChannelWrapper.java
Created September 14, 2020 16:30 — forked from ochinchina/AsynchronousSocketChannelWrapper.java
AsynchronousSocketChannel wrapper to support completely asyn operations
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.CompletionHandler;
import java.util.LinkedList;
import java.util.concurrent.TimeUnit;
/**
* This class wraps the AsynchronousSocketChannel reading and writing operations. The wrapped reading and writing operations is
* completely asynchronous operation. No any exception will be thrown from the read/write operation. If any exception occurs
* during read & write, the failed() method in CompletionHandler will be called.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
// Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material/checkbox';
import {MatButtonModule} from '@angular/material/button';
import {MatInputModule} from '@angular/material/input';
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {MatDatepickerModule} from '@angular/material/datepicker';
@rruffer
rruffer / progress.xml
Created September 23, 2019 16:27 — forked from Antarix/progress.xml
Android ProgressBar indeterminateDrawable
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:duration="1" /*Duration = 1 means that the rotation will be done in 1 second*/
/*increase duration if you want to speed up the rotation*/
android:toDegrees="360"
>
@rruffer
rruffer / UnabledSSL.java
Last active July 8, 2019 17:31 — forked from mefarazath/GagSsl.java
Ignorar Erros ssl no retrofit.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
String authType) throws CertificateException {
}
@rruffer
rruffer / JQueryWebView.java
Created July 24, 2017 14:36 — forked from jewelsea/JQueryWebView.java
Embeds jQuery in a document loaded into a WebView.
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import org.w3c.dom.Document;
/**
@rruffer
rruffer / convertUTF8toISO-description.txt
Created October 5, 2016 12:57 — forked from luis-fss/convertUTF8toISO-description.txt
Convertendo de UTF-8 para ISO-8859-1 em Java: A solução definitiva
Recentemente enfrentei problemas em um aplicativo Android que desenvolvi, o qual se comunica com o banco de dados de um dos sistemas da empresa, codificado em ISO-8859-1 (Firebird) através de um web service.
Os dados eram gravados de forma errada, muitas vezes truncavam e as vezes apareciam caracteres estranhos.
Depois de algumas tentativas, cheguei até a seguinte solução: