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 random | |
| import logging | |
| from sys import argv | |
| comparisons_done = 0 | |
| logging.getLogger().setLevel(logging.DEBUG) | |
| def binary_search(list, target): | |
| logging.debug(f'list: {list}') |
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
| kubectl -n <ns> edit deployment <svc-name> |
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
| /// <summary> | |
| /// Publishes the content item with the provided ID | |
| /// </summary> | |
| /// <param name="id">The id identifying the item</param> | |
| /// <returns></returns> | |
| public async Task<int> PublishItem(string id) | |
| { | |
| _logger.LogTrace($"PublishItem({id})"); | |
| if (string.IsNullOrWhiteSpace(id)) |
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
| using AutoMapper; | |
| using KT.Content.Data.Definition; | |
| using KT.Content.Data.Exceptions; | |
| using KT.Content.Data.Models; | |
| using Microsoft.Extensions.Logging; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using System.Net.Http; |
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 requests | |
| import argparse | |
| def retrieve_token(token_uri, client_id, client_secret): | |
| r = requests.post(f"{token_uri}", | |
| data={'client_id':f"{client_id}",'grant_type': 'client_credentials','client_secret': f"{client_id}", 'scope': 'targeting-api'}, | |
| headers={'Content-Type':'application/x-www-form-urlencoded'}) |
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
| s3_bucket = "demo.wtuo.com" | |
| # report_folder = "s3_bucket/${env.BUILD_NUMBER}" | |
| aws s3 cp dist/ "s3://${s3_bucket}" --recursive --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers |
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
| docker stop $(docker ps -a -q) | |
| docker rm $(docker ps -a -q) |
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
| System.setProperty('org.apache.commons.jelly.tags.fmt.timeZone', 'America/New_York') |
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
| if (id != base.UserID) | |
| { | |
| var token = this.GetAccessToken().Result; | |
| var currentUser = await _principal.Retrieve(this.User, token); | |
| if (!currentUser.IsImpersonator || !currentUser.CanActAsStudent) { | |
| return Unauthorized(); | |
| } | |
| } |
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
| git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch .vscode/launch.json' --prune-empty --tag-name-filter cat -- --all | |
| git update-index --assume-unchanged FILENAME_TO_IGNORE |