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
package main | |
import ( | |
"go/ast" | |
"go/format" | |
"go/parser" | |
"go/token" | |
"log" | |
"os" | |
"strings" |
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
// ==UserScript== | |
// @name Jira-Disable-Inline | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description disable jira issue click-to-edit (only applies few moments after page load, so you can have some grace time if you actually wanna edit) | |
// @author You | |
// @match https://*.atlassian.net/browse/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== |
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
class ModuleFilter(logging.Filter): | |
""" | |
Filters any logger from outside `root_path` to levels ERROR and above | |
""" | |
def __init__(self, root_path: str, *args, **kwargs): | |
self.root_path = root_path | |
super.__init__(*args, **kwargs) | |
def filter(self, record: logging.LogRecord) -> bool: |
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
using System; | |
using System.Collections; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using Castle.DynamicProxy; | |
using Microsoft.Extensions.Logging; | |
using Scrutor; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using Microsoft.AspNetCore.Routing; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace ServiceCollectionExtensions | |
{ | |
public static class ServiceCollectionExtensions |
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 | |
# USAGE: ./krsync.sh <src> <dst> , with either src/dst dir pointing to a pod (of the format 'pod:/<path>') | |
# Check if we are running within --rsh already (remote shell) | |
if [ -z "$KRSYNC_STARTED" ]; then | |
# not using --rsh | |
export KRSYNC_STARTED=true | |
exec rsync --blocking-io --rsh "$0" -a --progress --stats $@ # re-activate the script as remote shell | |
fi |
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 | |
# USAGE: gcr-cleanup.sh [tag-to-clean] | |
# if you want to cleanup a specific tag, pass its name, otherwise all non-tagged images will be cleaned | |
images=$(gcloud container images list --repository=gcr.io/xxx --format='get(name)') | |
for image_name in $images; do | |
if [ -n "$1" ] | |
then | |
gcloud container images untag --quiet $image_name:$1 |
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
import sys | |
import os | |
import pydevd | |
import logging | |
def stop_on(): | |
sys.path.append('/Applications/PyCharm.app/Contents/helpers/pydev/') | |
sys.path.append('/Applications/PyCharm.app/Contents/debug-eggs/') |
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
import gzip | |
import shutil | |
import logging | |
import os | |
from subprocess import Popen, PIPE, TimeoutExpired | |
SUCCESS_CODE = 0 | |
TIMEOUT_SECONDS = 600 |
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
import logging | |
import pandas as pd | |
import queue | |
from multiprocessing import Process, Queue | |
from time import sleep | |
DEFAULT_TIMEOUT_SEC = 60*10 | |
def _chunks(l, n): |
NewerOlder