Skip to content

Instantly share code, notes, and snippets.

View Galadirith's full-sized avatar

Edward Fauchon-Jones Galadirith

View GitHub Profile
@Galadirith
Galadirith / tutorial.md
Created January 18, 2024 14:42 — forked from Makeshift/tutorial.md
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@Galadirith
Galadirith / Obsidian Git-Mobile.md
Created January 18, 2024 12:43 — forked from yuvve/Obsidian Git-Mobile.md
Automatically sync notes to and from git repository whenever you open and close Obsidian on mobile.

How to automatically sync Obsidian between Github and Android with Termux and Tasker

I use Obsidian git on PC, and this workaround (since the plugin doesn't support mobile) to seamlessly* sync my notes to and from my phone. Using these instructions you create an automation for pulling every time you open Obsidian, and pushing every time you close it.

* you can still get merge conflicts...

Preparation

  1. Install Tasker.
  2. Install Termux.
  3. Install Termux tasker plugin.
  4. Open Termux and write termux-setup-storage, give it permissions.
@Galadirith
Galadirith / english-words.txt
Created September 19, 2023 18:23 — forked from hyper-neutrino/english-words.txt
3000 common english words
a
abandon
ability
able
abortion
about
above
abroad
absence
absolute
@Galadirith
Galadirith / zigzag-encoding.README
Created August 27, 2023 22:34 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@Galadirith
Galadirith / markdown-details-collapsible.md
Created June 28, 2023 12:15 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

How to add a collapsible section in markdown.

Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@Galadirith
Galadirith / docker-heredoc-snippet
Created February 10, 2022 12:30 — forked from mbreese/docker-heredoc-snippet
Running docker with a HEREDOC to script the commands to run inside the container.
docker run -v /Users/mbreese/tmp:/tmp1 -w /tmp1 -i centos:7 /bin/bash -s <<EOF
date > foo
echo 'foo' >> foo
cat /etc/redhat-release >> foo
whoami >> foo
EOF
@Galadirith
Galadirith / ping-test.sh
Created February 2, 2022 23:11 — forked from PHLAK/ping-test.sh
24 hour while loop in bash
#!/bin/bash
## Script start time
START=$(date +%s)
## Total run time
DURRATION=$((60 * 60 * 24))
## Total running time
UPTIME=$(($(date +%s) - $START))
@Galadirith
Galadirith / MatlabClasses.ipynb
Created January 20, 2022 13:27 — forked from mbauman/MatlabClasses.ipynb
Documenting how to parse Matlab's opaque class structure for MAT files with Julia.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Galadirith
Galadirith / 00.learn Architectural.md
Created November 20, 2020 01:10 — forked from dulao5/00.learn Architectural.md
Fielding, Roy Thomas. Architectural Styles and the Design of Network-based Software Architectures. Doctoral dissertation, University of California, Irvine, 2000.

基本概念

image

2.2 評価

評価 image 追加スタイル image

@Galadirith
Galadirith / script.js
Last active June 15, 2020 10:44
dev.to light syntax colour for code snippets in articles, the editor, and article comments
function add_css(rule) {
let css = document.createElement('style');
css.type = 'text/css';
css.appendChild(document.createTextNode(rule));
document.getElementsByTagName("head")[0].appendChild(css);
}
let rule = '.container .body pre, .crayons-article__body pre, div.inner-comment div.body div.highlight pre.highlight {background: hsla(240, 6%, 4%, 1); filter: invert(1);}';
rule += '.container .body pre code, .crayons-article__body pre code {background: hsla(240, 6%, 4%, 1);}';
add_css(rule)