Skip to content

Instantly share code, notes, and snippets.

View tallguyjenks's full-sized avatar
🌱
Growing useful code

Bryan Jenks tallguyjenks

🌱
Growing useful code
View GitHub Profile
@cfraizer
cfraizer / jenks.sh
Created June 4, 2020 03:12
Pure Bash vs. Sed
foo() {
local -a statusValues=(
"Discharging"
"Not Charging"
"Charging"
"Unknown"
"Full"
)
@tin2tin
tin2tin / fcpx_markers_import.py
Last active August 27, 2020 17:09
Import Final Cut Pro X markers from fcpxml files and insert them as markers and subtitles in Blender
import bpy
'''
Project Purpose:
Extract markers and time codes from Final Cut Pro X's FCPXML 1.3 formatted files
Pass an XML element into Marker.scanForMarker(). If markers are found, they are inserted as markers and subtitles in Blender.
'''
import bpy, sys, datetime
from xml.etree.ElementTree import parse
# Converts the '64bit/32bits' timecode format into seconds
@johnnydecimal
johnnydecimal / cjdfunction.sh
Created September 7, 2018 00:49
Bash function to jump to any Johnny.Decimal folder
# https://johnnydecimal.com
cjdfunction() {
pushd ~/Dropbox/*/*/${1}* # ~/Dropbox is my root folder, change to suit yours.
}
export cjdfunction
alias cjd='cjdfunction' # Or any other alias you prefer.
@ChrisK91
ChrisK91 / View HTML source with JavaScript and CSS styles.py
Created February 17, 2018 16:15
Reupload of the "View HTML source with JavaScript and CSS styles" add on for anki
# -*- mode: Python ; coding: utf-8 -*-
# • View HTML source with JavaScript and CSS styles
# https://ankiweb.net/shared/info/1128123950
# https://github.com/ankitest/anki-musthave-addons-by-ankitest
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
# Copyright (c) 2016 Dmitry Mikheev, http://finpapa.ucoz.net/
#
# Menu Cards - View Source code Body Alt+F3
# shows HTML source with JavaScript and CSS styles
# but without jQuery Menu Cards
@Jonas1510
Jonas1510 / music_bot_example.py
Created November 4, 2021 04:52 — forked from vbe0201/music_bot_example.py
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
# Save your R package list:
packages <- levels(as.data.frame(installed.packages()[,1])[,1])
write.csv(packages, "requirements.txt", row.names = FALSE, quote = FALSE)
# Load your R package list:
backup <- levels(read.csv("requirements.txt")[,1])
# Install your package list on a new machine:
install.packages(backup)
@tobi
tobi / kindle.rb
Last active September 25, 2022 02:37
Download your Kindle Highlights to local markdown files. Great for Obsidian.md.
#!/usr/bin/env ruby
# gem install active_support
require 'active_support/inflector'
require 'active_support/core_ext/string'
# gem install webrick (only ruby3)
require 'webrick'
# gem install mechanize
@GitMurf
GitMurf / obsidian.templater.move-line.js
Last active October 10, 2023 11:56
Move the active line of the active file to a chosen file.
<%*
//v1.6.2: Fix with update to Templater where wasn't removing the selected text/line "on move"
//'first' will add to top of file. 'last' will add to bottom of file
let firstOrLastLine = 'last';
//Choose a specific line to move to underneath; overrules firstOrLastLine if true
const bChooseLine = false;
//After moving the line, open the file it was moved to
@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active January 12, 2024 10:51
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

```dataviewjs
// find dates based on format [[YYYY-MM-DD]]
const findDated = (task)=>{
if( !task.completed ) {
task.link = " " + "[[" + task.path + "|*]]";
task.date="";
const found = task.text.match(/\[\[([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\]\]/);
if(found) task.date = moment(found[1]);
return true;
}