Skip to content

Instantly share code, notes, and snippets.

View abner's full-sized avatar

Ábner Silva de Oliveira abner

View GitHub Profile
@abner
abner / .p10k.zsh
Last active August 18, 2021 19:12
Configurações ZSH
# Generated by Powerlevel10k configuration wizard on 2021-07-03 at 16:54 PDT.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 19275.
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time,
# 2 lines, solid, left frame, dark-ornaments, compact, many icons, fluent,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@abner
abner / script.main.kts
Created May 24, 2021 10:08
Kotlin Script
#!/usr/bin/env kotlin
@file:Repository("https://jcenter.bintray.com")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.11")
import kotlinx.html.*; import kotlinx.html.stream.*; import kotlinx.html.attributes.*
val addressee = args.firstOrNull() ?: "World"
print(createHTML().html {
@abner
abner / StringUtil.kt
Created May 18, 2021 19:59 — forked from adrianoluis/StringUtil.kt
Simple class to slugify text in Kotlin.
import java.text.Normalizer
object StringUtil {
fun slugify(word: String, replacement: String = "-") = Normalizer
.normalize(word, Normalizer.Form.NFD)
.replace("[^\\p{ASCII}]".toRegex(), "")
.replace("[^a-zA-Z0-9\\s]+".toRegex(), "").trim()
.replace("\\s+".toRegex(), replacement)
.toLowerCase()
@abner
abner / cadeias_certificados_serpro.sh
Created May 10, 2021 10:35
Script instalação cadeia certificados SERPRO
#!/bin/bash
## Author: Abner Oliveira
## REF:
### * https://intra.serpro.gov.br/noticias/noticias-2020/cadeias-de-certificacao-precisam-ser-atualizadas/
### * https://gist.github.com/leommoore/4a91060520333c25d93b
### Download
wget http://repositorio.serpro.gov.br/cadeias/serprossl.p7b && \
wget http://repositorio.serpro.gov.br/cadeias/acserprointssl.p7b && \
<link rel="shortcut icon" width=32px>
<canvas style="display: none" id="loader" width="16" height="16"></canvas>
<script>
class Loader {
constructor(link, canvas) {
this.link = link;
this.canvas = canvas;
this.context = canvas.getContext('2d');
this.context.lineWidth = 2;
@abner
abner / WSL-ssh-server.md
Created July 12, 2020 11:56 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@abner
abner / main.dart
Created May 7, 2020 14:05
Exemplo indicador de progresso
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@abner
abner / cloudSettings
Last active June 27, 2021 11:39
abnersynthwave
{"lastUpload":"2021-06-27T11:38:35.738Z","extensionVersion":"v3.4.3"}
@abner
abner / page_turn.dart
Created September 10, 2019 13:05 — forked from slightfoot/page_turn.dart
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@abner
abner / gist:753ea6ef9cf597321a6dfda286ad9787
Created June 7, 2019 21:35 — forked from pditommaso/gist:2265496
Read/write input/output stream of interactive process
import java.io.*;
public class TestProcessIO {
public static boolean isAlive(Process p) {
try {
p.exitValue();
return false;
}
catch (IllegalThreadStateException e) {