Skip to content

Instantly share code, notes, and snippets.

Avatar
🐽
The six honest serving-men: What, Why, When, How, Where and Who.

Prachi prachikhadke

🐽
The six honest serving-men: What, Why, When, How, Where and Who.
View GitHub Profile
@prachikhadke
prachikhadke / sparse_clones.md
Last active Jun 22, 2021 — forked from hofnerb/sparse_clones.md
Make sparse clone
View sparse_clones.md
git init <repo>
cd <repo>
git remote add -f origin <url>

This creates an empty repository with your remote, and fetches all objects but doesn't check them out. Then do:

git config core.sparseCheckout true
@prachikhadke
prachikhadke / nested-goroutines
Created May 7, 2020
Calling go routines from go routines
View nested-goroutines
package main
import (
"fmt"
"time"
)
func SayHello(name string) {
fmt.Printf("Hello %s!\n", name)
}
View read-write-access.sql
GRANT USAGE ON SCHEMA public TO readwrite;
GRANT SELECT ON ALL TABLES IN SCHEMA public To readwrite;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readwrite;
GRANT USAGE ON SCHEMA schema_name TO readwrite;
GRANT SELECT ON ALL TABLES IN SCHEMA schema_name To readwrite;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT ON TABLES TO readwrite;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA schema_name TO readwrite;
GRANT SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA schema_name TO readwrite;
@prachikhadke
prachikhadke / .kitchen.yml
Last active Nov 17, 2017
kitchen yml file
View .kitchen.yml
---
driver:
name: vagrant
provisioner:
name: chef_zero
verifier:
name: inspec
View test kitchen logs
op-chef pskhadke$ kitchen test
-----> Starting Kitchen (v1.19.0)
-----> Cleaning up any prior instances of <default-centos-74>
-----> Destroying <default-centos-74>...
Finished destroying <default-centos-74> (0m0.00s).
-----> Testing <default-centos-74>
-----> Creating <default-centos-74>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-7.4'...
==> default: Matching MAC address for NAT networking...
View scripted parameterized pipeline
node {
properties([
parameters([
string(name: 'DEPLOY_ENV', defaultValue: 'TESTING', description: 'The target environment', )
])
])
stage("Initialize") {
echo "echo ${params.DEPLOY_ENV}"
}
View parameterized declarative pipeline
pipeline {
agent any
parameters {
booleanParam(name: 'isFlag')
}
stages {
stage("Initialize") {
steps {