Skip to content

Instantly share code, notes, and snippets.

View robertocommit's full-sized avatar

roberto.commit robertocommit

View GitHub Profile
@robertocommit
robertocommit / copyPublicSchema.sql
Created February 24, 2024 12:20
Postgresql, copy public schema to staging schema
DO $$
DECLARE
table_rec record;
BEGIN
FOR table_rec IN SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
LOOP
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'staging' AND table_name = table_rec.table_name) THEN
EXECUTE 'TRUNCATE TABLE staging.' || table_rec.table_name || ';';
'Ultima realise counter + spettro adeguate le variabili per non avere count negativi oltre il riporto,
'e stabile lo zero batterie sempre per il medesimo motivo. Poi lettura della HV per un paio di secondi
'Firmware inserito dal ser n° 008 in avanti. I precedenti hanno bisogno di upgrade.
'Aggiunta funzione killer che dopo tot accensioni non procede....per annullarla accendere l'apparecchio
'senza collegare la sonda (variabile a 0) per alcuni minuti finchè rimuove il blocco da solo.
'Scheda contatore con ingresso interrupt0
$prog &HFF , &HE1 , &HD9 , &H00 '
' e lettura batteria + 2 trimmer di setup
$regfile = "m8def.dat"
$crystal = 8000000
##
# This is an adoption from Oh My Zsh for Google Cloud Shell
##
main() {
# Install zsh
sudo apt-get -qq update
sudo apt-get -qq install zsh -y
@robertocommit
robertocommit / get_user_agents.py
Created March 28, 2018 07:55
Get a full list of User Agents in a csv file
from bs4 import BeautifulSoup
import requests
response = requests.get('http://www.useragentstring.com/pages/useragentstring.php?name=All').text.encode('utf-8')
soup = BeautifulSoup(response, 'html.parser')
fd = open('user_agents.csv','a')
for user_agent in soup.findAll('li'):
fd.write(user_agent.get_text() + '\n')
fd.close()
@robertocommit
robertocommit / response.json
Last active December 18, 2017 19:44
Bittrex API - getticker response USDT-BTC
{
"success": true,
"message": null,
"result": {
"Bid": 18550,
"Ask": 18558.54000002,
"Last": 18540
}
}
@robertocommit
robertocommit / Main.gs
Last active December 18, 2017 19:55
Get USDT-BTC on Slack using Google Script
function main() {
// Insert here your WebHook URL obtained from Slack and the name of the channel
var slack_webhook_url = 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXXX/XXXXXXXXXXXXXXX';
var slack_channel_name = 'XXXXXXX';
var bittrex_url = 'https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC';
var url_response = UrlFetchApp.fetch(bittrex_url).getContentText();
var response_parsed = JSON.parse(url_response);
var last_usdt_btc = parseInt(response_parsed.result.Last);
send('*USDT-BTC* --> ' + last_usdt_btc, slack_channel_name);