Skip to content

Instantly share code, notes, and snippets.

@adrianogil
adrianogil / Task Backlog - Template.md
Created September 30, 2024 01:33
A Dataview-based task management system for Obsidian

Tasks

    const tasks = await dv.pages('#task').where(t => t.task_status != "Dropped" && t.backlog != null && dv.io.normalize(t.backlog) == dv.current().file.path);
    let completedTasks = tasks.where(t => t.task_status == "Done");
    let donePercentage = parseInt((completedTasks.length / tasks.length) * 100);
    if (tasks.length == 0) donePercentage = 0;
    dv.span('Total: ' + completedTasks.length + '/' + tasks.length);
    dv.span('<br><br>')
    dv.span("<progress value='" + donePercentage + "' max='100'></progress>" + " " + donePercentage + "%")
@adrianogil
adrianogil / unity_bashrc.sh
Last active October 4, 2017 21:51
Dynamic Unity alias for all installed versions
# Dynamic Unity versions alias
for file in /Applications/Unity*/ ; do
if [[ -d "$file" && ! -L "$file" ]]; then
base_file=`basename $file`
base_file=${base_file:5}
# echo "$base_file is a directory";
alias open-unity-${base_file}="${file}/Unity${base_file}.app/Contents/MacOS/Unity -projectPath \$PWD"
fi;
done
@adrianogil
adrianogil / nfc.cs
Created June 10, 2014 01:09
Conexão NFC usando Proximity
StreamSocket _streamSocket;
void OnTriggeredConnectionStateChanged(object sender, TriggeredConnectionStateChangedEventArgs args)
{
switch (args.State)
{
case TriggeredConnectState.Listening:
// Conectando como ouvinte
break;