Discover gists
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
var huginn = window.location.protocol + "//" + window.location.host | |
var auth_key = document.getElementsByName("csrf-token")[0].content; | |
for (var a in window.agentPaths) { | |
var url = huginn + window.agentPaths[a].match(/\/agents\/\d+/)[0] + "/remove_events" | |
console.log(url) | |
$.post(url,"_method=delete&authenticity_token=" + auth_key,function(data,success,xhr){ | |
console.log("finish",url) | |
}) | |
} |
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
[Unit] | |
Wants=network-pre.target | |
Before=network-pre.target shutdown.target | |
[Service] | |
User=root | |
ExecStart=/bin/sh -ec '\ | |
[ -x /usr/bin/wslinfo ] && [ "$(/usr/bin/wslinfo --networking-mode)" = "mirrored" ] || exit 0;\ | |
echo "\ | |
add chain ip nat WSLPREROUTING { type nat hook prerouting priority dstnat - 1; policy accept; };\ |
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
const app = Application.currentApplication() | |
app.includeStandardAdditions = true | |
function getJSON(path) { | |
const fullPath = path.replace(/^~/, app.pathTo('home folder')) | |
const contents = app.read(fullPath) | |
return JSON.parse(contents) | |
} | |
function run() { |
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
#!/bin/bash | |
#=========================================== | |
# Download URLs for the required libraries. | |
#=========================================== | |
# NOTE: if you add a URL here, you also need to add it to the | |
# $packages_to_build list to ensure the proper order. | |
declare -A urls=( |
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
'Attribute VB_Name = "GetLocalOneDrivePath" | |
' | |
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint | |
' synchronized Microsoft Office files (Works on Windows and on macOS) | |
' | |
' Author: Guido Witt-Dörring | |
' Created: 2022/07/01 | |
' Updated: 2024/04/23 | |
' License: MIT | |
' |
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
--[[ | |
mpv dynaudnorm filter with visual feedback. | |
Copyright 2016 Avi Halachmi ( https://github.com/avih ) | |
Copyright 2020 Paul B Mahol | |
License: public domain | |
Needs mpv with very recent FFmpeg build. | |
Default config: |
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
license: gpl-3.0 | |
height: 960 | |
border: no | |
redirect: https://observablehq.com/@d3/hierarchical-edge-bundling |
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
console.clear(); | |
function saveData(blob, fileName) | |
{ | |
var a = document.createElement("a"); | |
document.body.appendChild(a); | |
a.style = "display: none"; | |
var url = window.URL.createObjectURL(blob); | |
a.href = url; |
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
// | |
// Feel free to use this code in your project. | |
// Inspired by SO answer https://stackoverflow.com/a/65743126 | |
// Uses DeviceKit as a dependency https://github.com/devicekit/DeviceKit | |
// | |
import Foundation | |
import MessageUI | |
import DeviceKit |
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
var util = require('util'); | |
console.log(util.inspect(myObject, {showHidden: false, depth: null})); | |
# alternative shortcut | |
console.log(util.inspect(myObject, false, null)); | |
# stringifying alternative | |
console.log(JSON.stringify(myObject, null, 4)); |
NewerOlder