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
| """Sample Slack ping bot using asyncio and websockets.""" | |
| import asyncio | |
| import json | |
| import signal | |
| import aiohttp | |
| from config import DEBUG, TOKEN | |
| import websockets |
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
| # In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env | |
| # variable pointing GPG to the gpg-agent socket. This little script, which must be sourced | |
| # in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start | |
| # gpg-agent or set up the GPG_AGENT_INFO variable if it's already running. | |
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else |
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
| /** | |
| * Get a list of Events from a given Calendarurl | |
| * | |
| * @param {String} url | |
| * @param {String} user | |
| * @param {String} pass | |
| * @param {String} date from which to start like 20140101T120000Z | |
| * @param {String} date from which to stop like 20140102T120000Z, optional (can be undefined) | |
| * @param {function} cb | |
| */ |
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
| ### | |
| ### | |
| ### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
| ### https://christitus.com/windows-tool/ | |
| ### https://github.com/ChrisTitusTech/winutil | |
| ### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
| ### iwr -useb https://christitus.com/win | iex | |
| ### | |
| ### OR take a look at | |
| ### https://github.com/HotCakeX/Harden-Windows-Security |
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 bfs(graph, start): | |
| visited, queue = set(), [start] | |
| while queue: | |
| vertex = queue.pop(0) | |
| if vertex not in visited: | |
| visited.add(vertex) | |
| queue.extend(graph[vertex] - visited) | |
| return visited |
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 asyncio | |
| import random | |
| q = asyncio.Queue() | |
| async def producer(num): | |
| while True: | |
| await q.put(num + random.random()) | |
| await asyncio.sleep(random.random()) |
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
| package application; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class Algorithm { | |
| /** | |
| * Sweep around the given circle with the given distance and create the scan lines | |
| * @param startX |
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 django import forms | |
| from django.forms import widgets | |
| DELIMITER = ',' | |
| class MultiCheckboxChoiceInput(widgets.CheckboxChoiceInput): | |
| def __init__(self, *args, **kwargs): |
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
| #lang scheme/gui | |
| (define new-game #t) | |
| (define game-finished #f) | |
| (define user-move #\X) | |
| (define computer-move #\O) | |
| (define move-count 0) | |
| (define start-move user-move) |
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
| """ | |
| This is an extension of the technique first detailed here: | |
| http://sedimental.org/remap.html#add_common_keys | |
| In short, it calls remap on each container, back to front, using the accumulating | |
| previous values as the default for the current iteration. | |
| """ | |