Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
from sqlalchemy import create_engine
def test_create_excel():
# create some data
data = {'product_name': ['laptop', 'printer', 'tablet', 'desk', 'chair'],
'price': [1200, 150, 300, 450, 200]
}
# make it a data frame
@bruskiza
bruskiza / reflector.go
Created September 7, 2021 21:27
Go Reflector
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
)
@Scheduled(fixedRate = 5000)
public void doSomething() throws Exception {
log.info("Scheduled task run...");
File resource = new ClassPathResource("static/index.html").getFile();
String time = String.valueOf(Instant.now().toEpochMilli());
StringBuilder sb = new StringBuilder();
sb.append("<p>");
sb.append(time);
Files.write(resource.toPath(), sb.toString().getBytes());
@bruskiza
bruskiza / bitbucket-pipelines.yml
Created April 20, 2017 01:41
Deploy websites using rsync with BitBucket Pipelines
# This will rsync the contents of your build directory to the target server
image: alpine:latest
pipelines:
default:
- step:
script:
- apk add --update openssh-client rsync sshpass
- chmod -R 755 *
- sshpass -p "$FTP_PASSWORD" rsync -v -e "ssh -p $FTP_PORT" -arz --exclude='.git/' * $FTP_USER@$FTP_SERVER:$FTP_PATH