| Filter | Description | Example |
|---|---|---|
| allintext | Searches for occurrences of all the keywords given. | allintext:"keyword" |
| intext | Searches for the occurrences of keywords all at once or one at a time. | intext:"keyword" |
| inurl | Searches for a URL matching one of the keywords. | inurl:"keyword" |
| allinurl | Searches for a URL matching all the keywords in the query. | allinurl:"keyword" |
| intitle | Searches for occurrences of keywords in title all or one. | intitle:"keyword" |
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/bash | |
| # The code below does the following: | |
| # 1. Loop through each .sql file | |
| # 2. Loop through each line in each file | |
| # 3. If the line contains the word, then print the next word. | |
| # | |
| # invoke with: ./get_following_word.sh <word> | |
| # | |
| for file in ./**/*.sql; do | |
| awk '{for (I=1;I<NF;I++) if ($I == word) print $(I+1)}' word="$1" "${file}" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 heapq | |
| class MedianCalculator: | |
| def __init__(self): | |
| self.heaps = [], [] | |
| def add_num(self, num): | |
| small, large = self.heaps | |
| heapq.heappush(small, -heapq.heappushpop(large, num)) | |
| if len(large) < len(small): |
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
| -- Two dashes start a one-line comment. | |
| --[[ | |
| Adding two ['s and ]'s makes it a | |
| multi-line comment. | |
| --]] | |
| ---------------------------------------------------- | |
| -- 1. Variables and flow control. | |
| ---------------------------------------------------- |
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/bash | |
| # RSS feed header | |
| echo '<?xml version="1.0" encoding="UTF-8" ?>' > blog.xml | |
| echo '<rss version="2.0">' >> blog.xml | |
| echo ' <channel>' >> blog.xml | |
| echo ' <title>RSS feed title</title>' >> blog.xml | |
| echo ' <link>https://example.com</link>' >> blog.xml | |
| echo ' <description>Example RSS feed </description>' >> blog.xml |
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
| with "columns" as ( | |
| select ' - name: ' || column_name || '\n description: '|| lower(column_name) || ' (data type '|| lower(DATA_TYPE) || ')' | |
| as column_statement, | |
| table_name | |
| from information_schema.columns | |
| where table_schema = 'TABLE_NAME' | |
| order by 1 | |
| ), | |
| tables as ( |
All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14
Pros & Cons:
- Pro: You don't need to care about the layout.
- Con: You cannot control the layout.
Notes:
- Not all the features of Mermaid (in particular symbols
B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
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
| find . -type f -print0 | xargs -0 stat -f "%z" | awk '{b+=$1} END { | |
| if (b > 1073741824) { | |
| printf "%.2f GB\n", b/1073741824 | |
| } else if (b > 1048576) { | |
| printf "%.2f MB\n", b/1048576 | |
| } else if (b > 1024) { | |
| printf "%.2f KB\n", b/1024 | |
| } else { | |
| printf "%d bytes\n", b | |
| } |
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
| CREATE SECRET http ( | |
| TYPE HTTP, | |
| EXTRA_HTTP_HEADERS MAP { | |
| 'Authorization': 'Bearer sk_test_VePHdqKTYQjKNInc7u56JBrQ' | |
| } | |
| ); | |
| select unnest(data) as customers | |
| from read_json('https://api.stripe.com/v1/customers'); |
OlderNewer