This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Drop this in functions.php or your plugin. | |
// You NEED to have Parsedown.php also : https://github.com/erusev/parsedown | |
wp_embed_register_handler( | |
'github_readme_md', | |
'&https?:\/\/github\.com\/([a-zA-Z-_0-9/]+)\/([a-zA-Z]+)\.md&i', | |
__NAMESPACE__ . '\artpi_github_markdown_handler' | |
); | |
function artpi_github_markdown_handler( $matches, $attr, $url, $rawattr ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will animate an "Explosion" whenever you complete a TODO in Roam Research. | |
// See https://deliber.at/roam for more Roam goodies. | |
// Put this file under {{[[roam/js]]}} block. I have a page roam/js. Under that, I have {{[[roam/js]]}} and under that the javascript block | |
document.addEventListener("click", function ( e ) { | |
const target = e.target; | |
if ( | |
target.tagName === "INPUT" && | |
target.parentElement.className === "check-container" | |
) { | |
if (target.type === "checkbox" && target.checked ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Troamback by @artpi - see: | |
* https://piszek.com/roam/troamback | |
* For installation, put in your [[roam/js]]. Detailed instructions above. | |
* | |
* This script will put a reference in your daily page to a random block with a special tag. | |
* For example, I will get a reference on my daily page to a random block tagged with "Grateful". | |
*/ | |
// These are configurable: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("click", function ( e ) { | |
const target = e.target; | |
if ( | |
target.tagName === "BUTTON" && | |
target.innerText === 'WordPress' | |
) { | |
const id = target.closest('.roam-block').id; | |
const blockUid = id.substring(id.length - 9, id.length); | |
const data = window.roamAlphaAPI.q('[ :find (pull ?e [ :block/string :block/heading :block/order :block/children :block/refs :children/view-type {:block/children ...} {:block/refs [*]}]) :in $ ?uid :where [?e :block/uid ?uid]]', blockUid); | |
const text = blockToHTML( data[0][0] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://piszek.com/2013/03/13/walidacja-numeru-pesel-w-javascript/ | |
// Funkcja dekodujaca nr. Pesel | |
function peselDecode(pesel) { | |
// Wycinamy daty z numeru | |
var rok = parseInt(pesel.substring(0, 2), 10); | |
var miesiac = parseInt(pesel.substring(2, 4), 10) - 1; | |
var dzien = parseInt(pesel.substring(4, 6), 10); | |
// Pesel został wprowadzony w 20 wieku, ale zawiera modyfikatory na przysłość | |
// Miesiąc zawiera dodatkowe liczby dla dat z przyszłości. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; The app will show those queries in today's journal page, | |
;; the "NOW" query asks the tasks which need to be finished "now", | |
;; the "NEXT" query asks the future tasks. | |
;; Arturs comment: "A8C" is my work. I tag my work tasks with "A8C" | |
:default-queries | |
{:journals | |
[ | |
{:title "🛠 TODO" | |
:query (and (or (todo TODO) (todo DOING) ) ( not [[LATER]] ) ( not [[FollowUp]] ) ( not [[A8C]] ) ) | |
:collapsed? true} |
OlderNewer