Skip to content

Instantly share code, notes, and snippets.

View aadimator's full-sized avatar

Aadam aadimator

View GitHub Profile
@aadimator
aadimator / Notes Publish GH Action.yml
Created September 4, 2022 04:15
GH Action configuration file to automatically publish my Obsidian Vault using Quartz
name: Publish
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
concurrency:
@aadimator
aadimator / process_logseq_timestamped.js
Created February 12, 2022 17:46
LogSeq Timestamp Process
const notice = (msg) => new Notice(msg, 5000);
const log = (msg) => console.log(msg);
module.exports = async function processLogseq(params) {
const {app, quickAddApi: {yesNoPrompt, inputPrompt, utility}} = params;
const shouldRemove = await yesNoPrompt("Should I remove timestamps?", `If you say no, I'll process them to be default youtube timestamp links. If you say yes, I'll simply remove them.`);
let text = await utility.getClipboard();
text = text.toString();
@aadimator
aadimator / tana_paste.js
Last active October 5, 2022 06:26
Tana Paste Translator
{
"translatorID": "dda092d2-a257-46af-b9a3-2f04a55cb04f",
"label": "Tana Metadata Export",
"creator": "Stian Håklev based on Joel Chan's work",
"target": "md",
"minVersion": "2.0",
"maxVersion": "",
"priority": 200,
"inRepository": true,
"translatorType": 2,
@aadimator
aadimator / index.js
Created August 20, 2022 05:05
Add id (nanoid) YAML property to all .md files
import { nanoid } from 'nanoid';
import {globby} from 'globby';
import matter from 'gray-matter';
import { writeFile } from 'fs';
const NOTES_DIR = "../notes_temp"
const paths = await globby(NOTES_DIR, {
expandDirectories: {
extensions: ['md']
@aadimator
aadimator / simulator_client.bat
Created October 23, 2021 06:00
Carla Simulator Scripts for EmoCaps
@REM start ../CarlaUE4.exe
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
@aadimator
aadimator / resume.json
Last active July 31, 2021 18:08
My Resume.json file
{
"basics": {
"name": "Aadam",
"email": "aadimator@gmail.com",
"phone": "+923225396069",
"location": {
"address": "Haripur, Pakistan"
},
"website": "aadimator.com"
},
@aadimator
aadimator / publish.yml
Created August 25, 2020 01:51
Workflow for auto-publishing notes using Jekyll digital-garden-template
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
n = int(input().strip())
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
print(sum(arr))
@aadimator
aadimator / cs221_quiz_1_solution.cpp
Created September 25, 2019 12:39
CS221 - Quiz 1 Solution
// Statement: Suppose we have one way linked list. Write a function to add a node in the linked list such that the resulting list is a sorted one.
#include<iostream>
using namespace std;
class List {
private:
@aadimator
aadimator / fractional_knapsack.cpp
Created July 25, 2016 02:49
Fractional Knapsack
#include <iostream>
#include <vector>
using std::vector;
int get_max_index (vector<int> weights, vector<int> values) {
int max_i = 0;
double max = 0;
for (int i = 0; i < weights.size(); i++) {