Skip to content

Instantly share code, notes, and snippets.

View iandol's full-sized avatar
👾
typing away...

Ian Max Andolina iandol

👾
typing away...
  • Institute of Neuroscience, Chinese Academy of Sciences
  • Shanghai
  • 01:51 (UTC +08:00)
View GitHub Profile
@zverhope
zverhope / bookends-generate_bib.py
Last active December 30, 2020 13:35
Auto-generate and regularly update bib file from Bookends library
#!/usr/bin/env -S PATH="${PATH}:/usr/local/bin" PYTHONIOENCODING=UTF-8 LC_ALL=en_US.UTF-8 python
# -*- coding: utf-8 -*-
then = "20201229160152"
import re, shutil, sys
import os.path, time
from datetime import datetime as dt
import json
from subprocess import Popen, PIPE
@JakeCoxon
JakeCoxon / distribute.py
Created December 24, 2020 21:32
Blender addon to distribute objects along an axis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@m-radzikowski
m-radzikowski / script-template.sh
Last active April 25, 2024 18:43
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@nottux
nottux / opencl-amd_aur_ubuntu.bash
Last active October 19, 2023 20:23
bash implementation of opencl-amd AUR package, Install opencl amdgpu amdgpu-pro opencl only. Supports ubuntu and others with standard prefix
#!/bin/bash
# DO NOT run the line 167 standalone. It will remove the necessary files besides the junk!
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h\|\-\-no\-deb\|\-\-no\-install\|\-\-no\-cleaning\|\-\-assume\-debian"
then :
else echo wrong entry\(ies\) !
help=yes
fi
if echo $@|grep -q "\-\-help\|\-help\|\-h\|help\|\-\-h" || [ "$help" = yes ]
set myBibFile to "/Users/zhope/Dropbox/Sundry/Library.bib"
if myBibFile exists then
set currentBibs to do shell script "/usr/local/bin/pandoc-citeproc --bib2json " & quoted form of myBibFile & " | /usr/local/bin/jq -r ' .[] | \"\\(.id)\"'"
set currentBibs to paragraphs of currentBibs
end if
set bibFile to POSIX file myBibFile
my write_to_file("", bibFile, true)
@e11s
e11s / amphetamine-on
Created January 9, 2019 23:45
Amphetamine Control AppleScript
on alfred_script(q)
tell application "Amphetamine"
set sessionActiveTest to session is active
if sessionActiveTest is false then
if (q is not in {"", null}) then
@zverhope
zverhope / be_orphaned_files.scpt
Last active December 16, 2022 08:24
Find orphaned files in Bookends, whether with hierarchical or flat folder structure, and then move to Orphans folder
set theFolder to (path to home folder as text) & "Library:Mobile Documents:iCloud~com~sonnysoftware~bot:Documents"
set BEList to {}
set orphanList to {}
set FinderList to {}
set pathList to {}
set od to AppleScript's text item delimiters
tell application "Finder"
-- create a list of the name of every file in the folder you've set
set FinderList to every file of folder theFolder as alias list
@bpj
bpj / pandoc-class2style.pl
Last active June 9, 2017 12:55
pandoc-class2style.pl - filter to translate single pandoc classes into attribute lists or LaTeX commands (with POD documentation)
#!/usr/bin/env perl
# pandoc-class2style.pl - filter to translate single span/div classes into LaTeX commands and attribute lists
# POD documentation below the code!
use utf8;
use autodie 2.29;
use 5.010001;
use strict;
@naupaka
naupaka / bookends_to_bibtex.scpt
Last active November 15, 2021 22:15
Applescript to export selected groups in the Bookends bibliography management software to bibtex files
#!/usr/bin/osascript
(*
Script written by Naupaka Zimmerman
March 17, 2017
MIT License
Copyright (c) 2017 Naupaka Zimmerman
@JMichaelTX
JMichaelTX / Create Hyperlink with Custom Protocol from Selected Text.applescript
Created August 3, 2016 05:46
AppleScript to Create Rich Text Hyperlink with Custom Protocol from Selected Text