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
SSH into AWS ec2/ Digitalocean droplet/ or else other PAAS, linux machine
$sudo apt install docker.io
$sudo usermod -aG docker $USER
I already installed docker
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}") { |
import ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%s@xxx.xx' % username |
import asyncio | |
import threading | |
import random | |
def thr(i): | |
# we need to create a new loop for the thread, and set it as the 'default' | |
# loop that will be returned by calls to asyncio.get_event_loop() from this | |
# thread. | |
loop = asyncio.new_event_loop() |
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
brew install coreutils | |
sudo ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout |
from celery import Task | |
from django.conf import settings | |
from django.core.cache import caches | |
from celery.utils.log import get_task_logger | |
logger = get_task_logger(__name__) | |
# noinspection PyAbstractClass | |
class TaskWithLock(Task): | |
""" |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Tree<T> : ICollection<T>, IList<T> where T : IComparable<T> | |
{ | |
public class TreeNode : ICollection<T>, IList<T> | |
{ | |
public TreeNode(T value, Tree<T> tree) | |
{ |
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.
using System; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.ExceptionServices; | |
using System.Threading; | |
namespace Fibers | |
{ | |
public struct AsyncFiberMethodBuilder<T> | |
{ | |
private Fiber<T>? fiber; |