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
@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.
```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;
}
@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
@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
@liamcain
liamcain / obsidian-pagebreaks.css
Created November 8, 2020 01:04
Obsidian Pagebreaks
/**
Create pagebreaks in exported Obsidian PDFs.
Example:
# Heading 1
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and scrambled it to make a type
@cfraizer
cfraizer / jenks.sh
Created June 4, 2020 03:12
Pure Bash vs. Sed
foo() {
local -a statusValues=(
"Discharging"
"Not Charging"
"Charging"
"Unknown"
"Full"
)
# 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)
@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

@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@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