Skip to content

Instantly share code, notes, and snippets.

Avatar
⚛️
Working Hard Ya !

Sóstenes Apollo sostenesapollo

⚛️
Working Hard Ya !
View GitHub Profile
@sostenesapollo
sostenesapollo / download.js
Created Jan 24, 2020 — forked from mbejda/download.js
Download Private Github Repo with Node.js Request module
View download.js
var owner = "mbejda";
var repo = "somerepo";
var branch = "master"
var accessToken = "AccessToken";
var options = {
method: "GET",
url: `https://api.github.com/repos/${owner.toLowerCase()}/${repo.toLowerCase()}/tarball/${branch}?access_token=${accessToken}`,
headers: {
'Accept': 'application/vnd.github.v3.raw',
View services.html
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.js"></script>
@sostenesapollo
sostenesapollo / dropbox.js
Created Feb 3, 2020
dropboxautoupdate.js
View dropbox.js
var fs = require('fs')
var request = require('request')
var key = ' INSERT YOUR API KEY HERE! '
function save (filename, userCode, file){
return new Promise((resolve, reject)=>{
var content = fs.readFileSync(filename);
options = {
method: "POST",
url: 'https://content.dropboxapi.com/2/files/upload',
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 = `
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 nothing.txt
https://drive.google.com/open?id=1MZpgKOdLDNG-gS0E8uhgQIuKfcHAnzxd
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 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 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 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,