sequenceDiagram
autonumber
participant UI as UI
participant BS as Business Service
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 tempfile | |
| import os | |
| import time | |
| import configparser | |
| import sys | |
| import wx | |
| def get_chrome_path_from_user(): | |
| app = wx.App(None) |
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
| #!/bin/zsh | |
| if [ "$1" != "" ] | |
| then | |
| MYPORT="$1" | |
| else | |
| MYPORT="8080" | |
| fi | |
| MYURL="http://localhost:$MYPORT/" | |
| echo "Opening [$MYURL] (iTerm2 - Press ⌘⌥ to make link clickable)" |
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
| def stretch_to(items, target_len: int, items_len: int = None): | |
| """ | |
| Stretch an array to a longer one where items are uniformly distributed | |
| """ | |
| import random | |
| items_len = len(items) if items_len is None else items_len | |
| for i in items: | |
| for i2 in range(round(random.uniform(0.0, (target_len - 1) / (items_len - 1)))): | |
| yield i |
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/local/bin/python | |
| from pyPdf import PdfFileWriter, PdfFileReader | |
| import random | |
| from pprint import pprint as pp | |
| import sys | |
| # sys.setrecursionlimit(10000000) | |
| seed = 'BN9F' | |
| pile = [1] | |
| def getNumber(): |
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
| # From: https://github.com/okta/samples-python-flask/blob/master/okta-hosted-login/main.py | |
| from flask import Flask, render_template, url_for, redirect | |
| from flask_oidc import OpenIDConnect | |
| app = Flask(__name__) | |
| app.config.update({ | |
| 'SECRET_KEY': 'SomethingNotEntirelySecret', | |
| 'OIDC_CLIENT_SECRETS': './client_secrets.json', | |
| 'OIDC_ID_TOKEN_COOKIE_SECURE': False, |
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
| // ==UserScript== | |
| // @name Trollify | |
| // @namespace Trollifyjs | |
| // @include * | |
| // @author ygilad | |
| // @description This userscript will replace all images with a picture of a troll | |
| // ==/UserScript== | |
| window.addEventListener('load', function() { | |
| var images = document.getElementsByTagName('img'); |
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
| curl https://gist.githubusercontent.com/ygilad/44a4873b0d4fa7c056fa7ac271ed6090/raw/python.gitignore > .gitignore |
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
| # Copied from https://stackoverflow.com/a/56539453/1853298 | |
| # Full credit to https://stackoverflow.com/users/1940851/kent-kostelac | |
| import base64 | |
| base64Img = '' | |
| with open("sanity-testing.png", "rb") as imageFile: | |
| base64Img = base64.b64encode(imageFile.read()) |
NewerOlder