Skip to content

Instantly share code, notes, and snippets.

@Foadsf
Foadsf / test_file_one.txt
Created March 24, 2020 14:37
trying to git branch, checkout, and rename a folder in abash script
test
@Foadsf
Foadsf / dev.py
Last active March 8, 2020 10:30 — forked from JannieT/dev.py
Environment for scripting LibreOffice with Python
import uno
import sys
def createUnoService(id):
ctx = getContext()
return ctx.ServiceManager.createInstanceWithContext(id, ctx)
def getContext():
# get the uno component context from the PyUNO runtime
localContext = uno.getComponentContext()
@Foadsf
Foadsf / README.md
Last active March 22, 2024 05:57
Scripting LibreOffice with Python

This tutorial was originally written by Jannie Theunissen on onesheep.org. However, the website has been down for a while and this a clone from the web.archive.org backup. Also, the parts regarding the macOS are updated according to this post. You may find OneSheep here on Twitter and Jannie Theunissen here on StackOverflow. If you have any comments on this Gist please poke me here on Twitter, otherwise, I might miss your comments.

Scripting LibreOffice with Python

We were recently asked to automate some editing tasks for the Spotlight English editors w

@Foadsf
Foadsf / CMakeLists.txt
Last active February 5, 2020 13:08
testing command line arguments double pointer type casting for pybind11
cmake_minimum_required(VERSION 2.8.12)
project (example)
find_package(pybind11 REQUIRED)
pybind11_add_module(${PROJECT_NAME} example.cpp)
@Foadsf
Foadsf / EFT.ipynb
Last active October 19, 2019 18:58
Easy Fourier transform: implementing 3Blue1Brown's interpretation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
time theta1 theta2
0 0 0
0 0 0
0 0 0
0.02 -6.40192 -7.79226
0.04 -12.8038 -12.1422
0.06 -19.2058 -18.1304
0.08 -25.6077 -26.7809
0.1 -32.0096 -32.5266
0.12 -38.4115 -36.9923
@Foadsf
Foadsf / testData.mo
Created September 11, 2019 12:34
modelica code for this question https://stackoverflow.com/q/57886368/4999991
model testData
extends Modelica.Icons.Example;
import Modelica.Math.Random.Generators;
import Modelica.Math.Random.Utilities;
parameter Real k = 50.0;
parameter Real J = 0.001;
Real theta1;
Real theta2;
@Foadsf
Foadsf / Answer.md
Created July 18, 2019 06:59
Installing DOS Navigator ( dn ) on FreeDOS
  1. Ok first of all if you have issues installing FreeDOS on VirtualBox and you get weird infinite loop Invalid Opcode errors, [here][1] I wrote a small instruction how the installation should be done.

  2. Now when you have FreeDOS booted, from [here][2] you need to install the networking software and reboot.

  3. then you can run fdnpkg update to update the installed packages

  4. but you don't need to install dn as it comes with the FreeDOS iso file. all you need to do is:

  5. run FDIMPLES package manager

  6. go to Utilities

  7. find DN2 and select it

  8. reboot

@Foadsf
Foadsf / example.py
Last active April 17, 2019 22:28
example for this question
#%%
import os
os.chdir(os.getcwd())
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
@Foadsf
Foadsf / main.c
Created April 15, 2019 08:54
regarding this question for array append function in C using dynamic memory allocation
#include <stdio.h>
#include <stdlib.h>
typedef struct intlist_ {
int size;
int* list;
} intlist;
void append(intlist* arr, int value){