- Open Automator
- Create a new document
- Select Quick Action
- Set “Service receives selected” to
files or folders
inany application
- Add a
Run Shell Script
action- your default shell should already be selected, otherwise use
/bin/zsh
for macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- your default shell should already be selected, otherwise use
- if you're using something else, you probably know what to do 😉
#!/usr/bin/env bash | |
# Dumps everything in your Kubernetes cluster into folders a YAML files. | |
# Use it at your own risk. | |
set -e | |
CONTEXT=“$1” | |
if [[ -z ${CONTEXT} ]]; then |
"""Task locking with redis in celery is hard, and good examples are tough to come by. This is the approach that's | |
worked for me, based on great work that other folks have posted: | |
* https://breadcrumbscollector.tech/what-is-celery-beat-and-how-to-use-it-part-2-patterns-and-caveats/ | |
* http://loose-bits.com/2010/10/distributed-task-locking-in-celery.html | |
* https://redis.io/topics/distlock | |
This isn't polished,but hopefully it's useful. To verify it in our local test env we register the following test task in | |
our definitions file: | |
*** definitions.py *** |
With custom commands, you are one shortcut away to run commands thanks to the Quick Launch (Ctrl+P, ⌘+P).
Custom commands can be configured in File > Preferences > Custom commands, or by editing the json file custom-commands.json
located in AppData/Local/Fork
on Windows and ~/Library/Application Support/com.DanPristupov.Fork/custom-commands.json
on MacOS.
Please share your own custom commands :)
Fork commands are posted as comments on this gist. Press CTRL+F to search for commands.
<?php | |
class UniqueURLSegmentExtension extends DataExtension | |
{ | |
private static $db = array( | |
'URLSegment' => 'Varchar(255)', | |
); | |
public function onBeforeWrite() | |
{ |
using System; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.ExceptionServices; | |
using System.Threading; | |
namespace Fibers | |
{ | |
public struct AsyncFiberMethodBuilder<T> | |
{ | |
private Fiber<T>? fiber; |
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
import jenkins.model.* | |
collectBuildEnv = [:] | |
@NonCPS | |
def getNodes(String label) { | |
jenkins.model.Jenkins.instance.nodes.collect { thisAgent -> | |
if (thisAgent.labelString.contains("${label}")) { | |
// this works too | |
// if (thisAagent.labelString == "${label}") { |
Tested only on Ubuntu 22.04, KDE Neon User Edition (based on Ubuntu 22.04) and OSX Mojave or higher.
will probably work on other newer versions, with no changes, or with few changes in non-python dependencies (apt-get
packages)
NOTE: Don't create a .sh file and run it all at once. It may will not work. Copy, paste, and execute each command below manually. :-)
# DO NOT RUN THIS AS A ROOT USER
SSH into AWS ec2/ Digitalocean droplet/ or else other PAAS, linux machine
- Install Docker
$sudo apt install docker.io
$sudo usermod -aG docker $USER
I already installed docker