Skip to content

Instantly share code, notes, and snippets.

# 1. Library imports
import pandas as pd
from pycaret.regression import load_model, predict_model
from fastapi import FastAPI
import uvicorn
# 2. Create the app object
app = FastAPI()
#. Load trained Pipeline
@tcz001
tcz001 / README.md
Last active November 26, 2021 10:13
run alpine linux on qemu on windows
  1. create a folder in C:\ as workspace (because download folder is a remote volumn, it won't be accessable in powershell/cmd.exe)
  2. download and unzip qemu pre-built binaries.
  3. download alpine-extended-x86_64 iso cdrom.
  4. use qemu-img.exe to create a disk image: qemu-img create hd.img 10G.
  5. download and run start.bat to execute qemu, it will boot from an alpine iso and mount an disk we just created.
  6. login use root, then run setup-alpine in command line, choose us timezone and keyboard layout, setup your root passwd, type enters until:
  • enable openssh service for later usage.
  • when asked "which disk would you like to use?" enter "sda".
  • when asked "How would you like to use it?"
@vurtun
vurtun / _readme_quarks.md
Last active March 29, 2025 00:56
Quarks: Graphical user interface

gui

@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 29, 2025 00:59
What you need to know to choose an open source license.
@fschr
fschr / main.cpp
Last active March 14, 2025 02:31
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// compile with: clang++ main.cpp -o hello_sdl2 -lSDL2
// run with: ./hello_sdl2
#include <SDL2/SDL.h>
#include <stdio.h>
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@ilebedie
ilebedie / python_like_print.hpp
Created July 14, 2015 10:28
Python-like print in c++
#include <iostream>
using namespace std;
void print(){cout<<'\n';}
template<typename T, typename ...TAIL>
void print(const T &t, TAIL... tail)
{
cout<<t<<' ';
@whoshuu
whoshuu / curlget.cpp
Created March 31, 2015 06:44
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@jay
jay / PostJSON.c
Last active July 31, 2022 20:35
Use libcurl to POST JSON data.
/* Use libcurl to POST JSON data.
Usage: PostJSON <name> <value>
curl-library mailing list thread:
'how do i post json to a https ?'
https://curl.haxx.se/mail/lib-2015-01/0049.html
* Copyright (C) 2015 Jay Satiro <[email protected]>
https://curl.haxx.se/docs/copyright.html
#!/usr/bin/env python
# This is an example Git server. http://blog.nerds.kr/post/106956608369/implementing-a-git-http-server-in-python
# Stewart Park <[email protected]>
from flask import Flask, make_response, request, abort
from StringIO import StringIO
from dulwich.pack import PackStreamReader
import subprocess, os.path
from flask.ext.httpauth import HTTPBasicAuth
@tejainece
tejainece / cgo1.go
Last active October 26, 2024 04:18
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {