In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| """ | |
| Results: | |
| multiple_update: 33 ms | |
| copy_and_update: 27 ms | |
| dict_constructor: 29 ms | |
| kwargs_hack: 33 ms | |
| dict_comprehension: 33 ms | |
| concatenate_items: 81 ms | |
| union_items: 81 ms |
| #!/bin/sh | |
| # ngrok's web interface is HTML, but configuration is bootstrapped as a JSON | |
| # string. We can hack out the forwarded hostname by extracting the next | |
| # `*.ngrok.io` string from the JSON | |
| # | |
| # Brittle as all get out--YMMV. If you're still reading, usage is: | |
| # | |
| # $ ./ngrok_hostname.sh <proto> <addr> | |
| # |
| ######################################################################### | |
| # Wifiscanner.py - A simple python script which records and logs wifi probe requests. | |
| # Author - D4rKP01s0n | |
| # Requirements - Scapy and Datetime | |
| # Inspiration - Tim Tomes (LaNMaSteR53)'s WUDS https://bitbucket.org/LaNMaSteR53/wuds/ | |
| # Reminder - Change mon0 (around line 65) to your monitor-mode enabled wifi interface | |
| ######################################################################### | |
| from datetime import datetime |
| -- POSTGRES SQL. | |
| -- Count of rows where a timestamp column falls in interval. | |
| -- This example uses a 5 minute interval ( 300 seconds = 5 minutes). | |
| -- You need to replace the things inside square brackets, i.e. provide | |
| -- the name of the table and timestamp column. | |
| SELECT COUNT(*) cnt, | |
| to_timestamp(floor((extract('epoch' from [Timestamp Column]) / 300 )) * 300) | |
| AT TIME ZONE 'UTC' as expiry_interval | |
| FROM [Table] GROUP BY expiry_interval | |
| order by expiry_interval |
| { | |
| "openapi": "3.0.2", | |
| "info": { | |
| "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", | |
| "version": "1.0.0", | |
| "title": "Swagger Petstore", | |
| "termsOfService": "http://swagger.io/terms/", | |
| "contact": { | |
| "email": "[email protected]" | |
| }, |
| %YAML 1.2 | |
| --- | |
| # http://www.sublimetext.com/docs/3/syntax.html | |
| name: Rego | |
| file_extensions: | |
| - rego | |
| - Rego | |
| scope: source.rego | |
| contexts: | |
| main: |
| # ⚠️ USE AT YOUR OWN RISK | |
| # first: pip install pysqlite3-binary | |
| # then in settings.py: | |
| # these three lines swap the stdlib sqlite3 lib with the pysqlite3 package | |
| __import__('pysqlite3') | |
| import sys | |
| sys.modules['sqlite3'] = sys.modules.pop('pysqlite3') | |
| DATABASES = { |