This file contains hidden or 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
$installLocation = "$env:LocalAppData\Programs\PowerToys" | |
$tempDir = Join-Path ([System.IO.Path]::GetTempPath()) (New-Guid) | |
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null | |
Push-Location $tempDir | |
$latestPowerToys = Invoke-WebRequest "https://api.github.com/repos/microsoft/PowerToys/releases/latest" | ConvertFrom-Json | |
$latestVersion = $latestPowerToys.tag_name.Substring(1) | |
$isInstalled = Test-Path "$installLocation\PowerToys.exe" | |
if ($isInstalled) { |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import sys | |
import subprocess | |
import re | |
SSH_COMMAND_PATTERN = r'ssh -t -i (?P<IdentityFile>.+?)(?P<options> -o .+) (?P<User>\w+)@(?P<HostName>\w+\.\d+)' | |
def main(): | |
instance_name = sys.argv[1] | |
command = ['gcloud', 'compute', 'ssh', '--tunnel-through-iap', '--dry-run'] |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import sys | |
import subprocess | |
import re | |
SSH_COMMAND_PATTERN = r'ssh -t -i (?P<IdentityFile>.+?)(?P<options> -o .+) (?P<User>\w+)@(?P<HostName>\w+\.\d+)' | |
def main(): | |
instance_name = sys.argv[1] | |
command = ['gcloud', 'compute', 'ssh', '--tunnel-through-iap', '--dry-run'] |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
from pathlib import Path | |
from pprint import pprint | |
from typing import NamedTuple | |
import functools | |
import contextlib | |
import sqlparse | |
import fire |
This file contains hidden or 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
#!/usr/bin/env python | |
import sys | |
import traceback | |
import functools | |
import google.cloud.logging | |
from loguru import logger | |
def without_keys(d, keys): | |
return {x: d[x] for x in d if x not in keys} |
This file contains hidden or 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 os | |
from resources import AbstractDatabaseConnector, EnvInterface | |
class EnvVarGetter(EnvInterface): | |
@property | |
def env(self): | |
'''Get env from envvar''' | |
return os.environ['APP_ENV'] |
This file contains hidden or 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 re | |
>>> from functools import reduce, partial | |
>>> from operator import add, itemgetter | |
>>> def compose2(f, g): | |
... return lambda *args, **kwargs: f(g(*args, **kwargs)) | |
>>> def compose(*functions): | |
... return reduce(compose2, functions) |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
from itertools import accumulate, groupby, islice, tee | |
from operator import itemgetter | |
from collections import deque | |
from functools import partial, wraps | |
def trace_iter(source): |
This file contains hidden or 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
2015-11-18 16:40:02 +0900 | |
./configure | |
--prefix=/usr/local/Cellar/python/2.7.10_2 | |
--enable-ipv6 | |
--datarootdir=/usr/local/Cellar/python/2.7.10_2/share | |
--datadir=/usr/local/Cellar/python/2.7.10_2/share | |
--enable-framework=/usr/local/Cellar/python/2.7.10_2/Frameworks | |
--without-ensurepip | |
--without-gcc |
This file contains hidden or 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
#!/usr/bin/env | |
# | |
# Requirements: | |
# argparse==1.2.1 | |
# pymongo==2.1 | |
# redis==2.4.10 | |
import redis | |
import pymongo | |
import argparse |
NewerOlder