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
SELECT | |
* | |
FROM {{db}}.{{nm}} | |
WHERE | |
rand() < 0.1 | |
AND UPDATED_TIMESTAMP BETWEEN CURRENT_DATE() - 7 AND DATE_SUB(CURRENT_TIME(), INTERVAL 2 HOUR) | |
LIMIT 10; |
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
LOAD A0 // byte | |
ns Registers | |
*2 L1 Cache (Kb) loads at min width / [A0 - A32] | |
*5 L2 Cache (Mb) " " / [A0 - A32] | |
*50 L3 Cache (Mbx10) " " / [A0 - A32] |
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
Spring Annotations & Interfaces 101 | |
@Configuration | |
- a singleton bean that is used to configure an application | |
- can be used as a component/bean itself | |
- can have 0 or more methods that register additional beans | |
- constructor can take parameters as long as these parameters can be resolved to already registered beans | |
@Component | |
- a singleton bean that provides functionality to application |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Printf("%#v\n", Identity('a')) | |
fmt.Printf("%#v\n", Identity(Box('a'))) | |
fmt.Printf("%#v\n", Identity(Unbox(Box('a')))) |
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
#!/usr/bin/env pwsh -File | |
param( | |
[switch] [Parameter(ParameterSetName = "teams")] $teams, | |
[switch] [Parameter(ParameterSetName = "projects")] $projects, | |
[switch] [Parameter(ParameterSetName = "repos")] $repos, | |
[switch] [Parameter(ParameterSetName = "prs")] $prs, | |
# Parameters specified by switch command | |
[Parameter(Mandatory = $true, ParameterSetName = "projects")] | |
[Parameter(Mandatory = $true, ParameterSetName = "repos")] |
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
#!/bin/bash | |
# Authentication variables | |
USER=${BITBUCKET_USER:-`cat .user`} | |
SECRET=${BITBUCET_SECRET:-`cat .secret`} | |
ORG=${BITBUCKET_ORG:-`cat .org`} | |
# Setup Initial URI | |
PAGELEN_QS="pagelen=${PAGELEN:-100}" | |
FIELDS_QS="fields=${FIELDS:-next,values.full_name,values.updated_on,values.language}" |
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
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size, | |
live_tuples, | |
dead_tuples, | |
(case | |
when ((live_tuples + dead_tuples) > 0) | |
then 100.0 * ((1.0 * dead_tuples) / (live_tuples + dead_tuples)) |
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
SELECT | |
table_name, | |
pg_size_pretty(table_size) AS table_size, | |
pg_size_pretty(indexes_size) AS indexes_size, | |
pg_size_pretty(total_size) AS total_size, | |
live_tuples, | |
dead_tuples, | |
(case | |
when ((live_tuples + dead_tuples) > 0) | |
then 100.0 * ((1.0 * dead_tuples) / (live_tuples + dead_tuples)) |
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
docker volume create PostgreSQLData | |
docker run -p 5432:5432 --name <<cntr_name>> -e POSTGRES_PASSWORD=<<pwd>> -d -v PostgreSQLData:/var/lib/postgresql/data postgres | |
docker logs <<cntr_name>> |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; https://gist.github.com/agarman/e0eed5ff2989f938ef2cf81be9b448bd | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Setup packages | |
(package-initialize) | |
(add-to-list 'package-archives | |
'("melpa-stable" . "https://stable.melpa.org/packages/") t) |
NewerOlder