Skip to content

Instantly share code, notes, and snippets.

View portothree's full-sized avatar
🎯
Focusing

Gustavo Porto portothree

🎯
Focusing
View GitHub Profile
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
import React from 'react';
import ReactDOM from 'react-dom';
class MyButton extends React.Component {
render() {
return <button
onClick={() => { this.props.handleClick(this.props.label); }}>{this.props.label}</button>
}
}
import requests
import json
headers = {'Authorization': 'Bearer '}
playlistID = '76BJ3Y6aE7TR0hW5QCop5n'
userInfo = 'https://api.spotify.com/v1/playlists/{}'.format(playlistID)
endpoint_100 = 'https://api.spotify.com/v1/playlists/{}/tracks?offset=0&limit=100'.format(playlistID)
endpoint_200 = 'https://api.spotify.com/v1/playlists/{}/tracks?offset=100&limit=100'.format(playlistID)
endpoint_300 = 'https://api.spotify.com/v1/playlists/{}/tracks?offset=200&limit=100'.format(playlistID)
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
profile = webdriver.FirefoxProfile()
profile.set_preference("general.useragent.override", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19")
profile.set_preference('permissions.default.image', 2)
profile.set_preference('dom.ipc.plugins.enable.libflashplayer.so', 'false')
driver = webdriver.Firefox(profile)
from pynput.keyboard import Key, Controller
keyboard = Controller()
keyboard.type('hello')
keyboard.press(Key.enter)
keyboard.release(Key.enter)
import requests
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)
endpoint = 'https://api.spotify.com/v1/playlists/37i9dQZF1DZ06evO2zakRW/tracks?offset=0&limit=100'
headers = {'Authorization': 'Bearer '}
data = requests.get(endpoint, headers=headers)
import requests
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)
headers = {'Authorization': 'Bearer '}
playlistID = '76BJ3Y6aE7TR0hW5QCop5n'
userInfo = 'https://api.spotify.com/v1/playlists/{}'.format(playlistID)
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
import pprint
pp = pprint.PrettyPrinter(indent=4)
DEVELOPER_KEY = ""
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
CREATE TABLE `noDup` LIKE `Dup` ;
INSERT `noDup` SELECT DISTINCT * FROM `Dup` ;
DROP TABLE `Dup` ;
ALTER TABLE `noDup` RENAME `Dup` ;
const express = require('express');
const app = express();
const port = 3333;
app.listen(port, () => {
console.log('O servidor está rodando na porta', port);
})