Skip to content

Instantly share code, notes, and snippets.

View Tombo1001's full-sized avatar
😐

Tom Cocking Tombo1001

😐
View GitHub Profile
@Tombo1001
Tombo1001 / gist:4951814
Last active December 13, 2015 17:58
Basic arrays in C
#include <stdio.h>
void main()
{
int a[10], i, j, k;
for (i=0; i<=9; i++)
{
a[i];
}
@Tombo1001
Tombo1001 / gist:5025797
Last active December 12, 2020 23:08
Taxi Rank Code #stage1
#include <stdio.h>
#define MAX_SIZE 100
void push ( int a[ ], int *top , int x);
int pop ( int a[ ], int *top);
void print ( int a[ ], int top );
int exit( );
int initialise( );
/////////////////////////////////////////
@Tombo1001
Tombo1001 / Python-InfluxDB.py
Last active January 19, 2021 08:41
Writing to an InfluxDB server with Python3
#!/usr/bin/python
from datetime import datetime
from influxdb import InfluxDBClient
def func_log(unit, kind, value):
client = InfluxDBClient(host='127.0.0.1', port=8086)
client.create_database('DBname')
client.switch_database('DBname')
json_body = [
{
@Tombo1001
Tombo1001 / exportbrave.ps1
Last active January 21, 2022 08:38 — forked from irlperu/exportchrome.ps1
Export Brave Browser Bookmarks
#Path to chrome bookmarks
$pathToJsonFile = "$env:localappdata\BraveSoftware\Brave-Browser\User Data\Default\Bookmarks"
$htmlOut = 'C:\temp\BraveBookmarks.html'
$htmlHeader = @'
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!--This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
@Tombo1001
Tombo1001 / chatgeepeepee.py
Created June 12, 2023 15:49
Convert bullet point ideas into markdown blogosts
import openai
import threading
import re
import os
from datetime import datetime
from dotenv import load_dotenv
# Configure your OpenAI API key
load_dotenv()
openai.api_key = os.environ.get('API_KEY')