This document contains snippets that I've used. For an extensive reference on the API, please visit the official documentation.
This is written under the assumption that you have created and have your bots' information. If not, visit: here
This was written by a 11/12yr old, do not expect it to be professional
Discover gists
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
""" SICP section 2.2.3, page 160. | |
We can rearrange the pieces and use them in computing the product of the squares of the odd integers in a sequence: | |
(define (product-of-squares-of-odd-elements sequence) (accumulate * 1 (map square (filter odd? sequence)))) | |
(product-of-squares-of-odd-elements (list 1 2 3 4 5)) | |
225 | |
2017-09-13 v1.0 Translated & benchmarked by Cees Timmerman | |
""" | |
from __future__ import print_function # For Python 2. |
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
"""Ported from https://www.java67.com/2018/03/how-to-implement-radix-sort-in-java.html | |
Sort an integer list in-place using least significant digit radix sort in Python. | |
Usage: | |
>>> x = [180, 50, 10, 30, 10, 29, 60, 0, 17, 24, 12]; radix_sort(x); x | |
[0, 10, 10, 12, 17, 24, 29, 30, 50, 60, 180] | |
Time Complexity of Solution: | |
Best Case O(k*n); Average Case O(k*n); Worst Case O(k*n), | |
where k is the length of the longest number and n is the | |
size of the input array. |
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
""" | |
This example bot is structured in multiple files and is made with the goal of showcasing commands, events and cogs. | |
Although this example is not intended as a complete bot, but as a reference aimed to give you a basic understanding for | |
creating your bot, feel free to use these examples and point out any issue. | |
+ These examples are made with educational purpose and there are plenty of docstrings and explanation about most of the code. | |
+ This example is made with Python 3.8.5 and Discord.py 1.4.0a (rewrite). | |
Documentation: |
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
# Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 1 | |
# Run instrumented program, generate and write pgo data | |
./runIt | |
# Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
make -j 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
admin account info" filetype:log | |
!Host=*.* intext:enc_UserPassword=* ext:pcf | |
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd | |
"AutoCreate=TRUE password=*" | |
"http://*:*@www” domainname | |
"index of/" "ws_ftp.ini" "parent directory" | |
"liveice configuration file" ext:cfg -site:sourceforge.net | |
"parent directory" +proftpdpasswd | |
Duclassified" -site:duware.com "DUware All Rights reserved" | |
duclassmate" -site:duware.com |
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
/* Flexbox | |
// ================================================== */ | |
.d--f { display: flex; } | |
.d--if { display: inline-flex; } | |
/* Flex direction */ | |
.fd--r { flex-direction: row; } /* Default */ | |
.fd--rr { flex-direction: row-reverse; } | |
.fd--c { flex-direction: column; } | |
.fd--cr { flex-direction: column-reverse; } |
If you're experiencing issues with your Mac connecting to the slower 2G band on routers that share SSID between 5G/2G (like the Google Wifi Nest), here's a guide to help you force a 5 GHz connection.
- Check Current Band: Hold
option
and click on the wifi icon on the macOS status bar. This will display the band you are currently connected to. - Scan WiFi Channels: Use the following command to list all channels your WiFi is operating on:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport scan
NewerOlder