Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Debugging

Sóstenes Apollo sostenesapollo

:octocat:
Debugging
View GitHub Profile
View eslint config
# ctrl , open settings.json
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
View install vnc server
$ sudo apt update
$ sudo apt install xfce4 xfce4-goodies
$ sudo apt install tightvncserver
$ vncserver
$ vncserver -kill :1
$ mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
$ nano ~/.vnc/xstartup
(paste the follow being in the xstartup file and write out)
#!/bin/bash
View openssh install.md

sudo apt install openssh-server && sudo systemctl enable ssh && sudo systemctl start ssh && ssh user@server-name

View zshrc
# LS_COLORS=$LS_COLORS:'ow=01;34:' ; export LS_COLORS
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/sostenes/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
View ScrollDown.js
const scrollDown = () => {
try {
var chatWindow = document.getElementById("div-id")
var xH = chatWindow.scrollHeight
chatWindow.scrollTo(0, xH)
} catch (e) {
console.log('Erro ao scrolar ou encontrar a div');
}
View Dashboard.tsx
import React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import Drawer from '@material-ui/core/Drawer';
import Box from '@material-ui/core/Box';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import List from '@material-ui/core/List';
import Typography from '@material-ui/core/Typography';
View tabetizr.js
/**
* TODO Tabletizer is a simple js module to help
* TODO devs to build tables very fast with pagination, search and crud options.
*
* ! 1- The ajax Data needs to be an object with two params
** Response example:
** [
** { totalRows:x, totalRowsThisPage:x }
** [
** { id:1, name: "asd"},
View nothing.txt
https://drive.google.com/open?id=1MZpgKOdLDNG-gS0E8uhgQIuKfcHAnzxd
View pandas commands
import pandas as pd
dataset1 = pd.read_table("http://bit.ly/movieusers",sep="|")
dataset2 = pd.read_table("http://bit.ly/movieusers",sep="|", header=None, names=user_cols,skipfooter=1)
user_cols = ['a','b','c','d','number']
dataset2.head()
View pagination.js
function paginate(id, qnt_total, pg_atual) {
let qnt_paginas = Math.ceil(qnt_total / config[id].querydefault.limit);
if(pg_atual > qnt_paginas){
pg_atual = qnt_paginas
}
var lateral = 2
var btns = ''
var pagina = `