Skip to content

Instantly share code, notes, and snippets.

View vitorkoch's full-sized avatar
📚

koch vitorkoch

📚
View GitHub Profile
@vitorkoch
vitorkoch / .tmux.conf
Created May 4, 2024 03:12
my tmux dotfile
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'egel/tmux-gruvbox'
set -g @tmux-gruvbox 'dark' # or 'light'
# Fix Colors
set -g default-terminal "screen-256color"
set -as terminal-features ",xterm-256color:RGB"
@vitorkoch
vitorkoch / template.tex
Last active June 18, 2023 20:10
A latex template for IFPA homeworks
\documentclass[12pt]{article}
\def\maintitle{}
\def\subject{}
\def\instituation{IFPA}
\author{}
\def\owner{}
\def\logopath{}
\def\mainfont{Times New Roman}
\def\mathfont{Stix Two Math}
@vitorkoch
vitorkoch / init.vim
Created December 30, 2022 13:47
My vim config
set nocompatible " disable compatibility to old-time vix
set showmatch " show matching
set ignorecase " case insensitive
set mouse=v " middle-click paste with
set hlsearch " highlight search
set incsearch " incremental search
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
set cc=120 " set an 80 column border for good coding style
filetype plugin indent on "allow auto-indenting depending on file type
@vitorkoch
vitorkoch / _document.js
Created October 7, 2022 13:23
Configuration for style components in React/Next JS
// Put in /pages folder
import Document from "next/document";
import { ServerStyleSheet } from "styled-components";
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
@vitorkoch
vitorkoch / markdown.md
Last active October 6, 2022 17:54
Guide to render Markdown in ReactJS

Rendering Markdown

  1. Put your markdown file in the /scr folder

  2. Install dependencies:

npm i --save react-markdown
npm i --save rehype-raw
npm i --save remark-gfm
@vitorkoch
vitorkoch / notification.ts
Last active October 2, 2022 18:57
Notification with sound in JavaScript/TypeScript
Notification.requestPermission().then((permission) => {
console.log("Notification permission", permission);
});
function playSound(url, volume = 1) {
const audio = new Audio(url);
audio.volume = volume;
audio.play();
}
@vitorkoch
vitorkoch / style.css
Last active September 21, 2022 20:38
Add Raleway font and fix numerals
@import url("https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap");
* {
-webkit-font-feature-settings: "lnum";
-moz-font-feature-settings: "lnum";
font-feature-settings: "lnum";
font-family: Raleway, sans-serif;
font-weight: 500;
}
@vitorkoch
vitorkoch / clocker.html
Created August 6, 2022 20:33
Clocker HTML placeholder
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="75px"><!--! Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M232 120C232 106.7 242.7 96 256 96C269.3 96 280 106.7 280 120V243.2L365.3 300C376.3 307.4 379.3 322.3 371.1 333.3C364.6 344.3 349.7 347.3 338.7 339.1L242.7 275.1C236 271.5 232 264 232 255.1L232 120zM256 0C397.4 0 512 114.6 512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0zM48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48C141.1 48 48 141.1 48 256z"/></svg>
Time<br>
<span id="time"></span>
<script>
function setTime() {
const date = new Date();
let hours = date.getHours()
if (hours < 10) {
hours = '0' + hours;
@vitorkoch
vitorkoch / API.js
Last active August 6, 2022 21:01
JavaScript Async API consume
async function getData(url) {
const response = await fetch(url)
const data = await response.json()
console.log(data)
}