Skip to content

Instantly share code, notes, and snippets.

View digvijaybhakuni's full-sized avatar

Digvijay Bhakuni digvijaybhakuni

View GitHub Profile
@digvijaybhakuni
digvijaybhakuni / MiniKube-GettingStarted.md
Last active November 18, 2019 16:29
k8s with minikube

Install Minikube

MacOS

sysctl -a | grep -E --color 'machdep.cpu.features|VMX' 

should 'VMX' display

minikube start
@digvijaybhakuni
digvijaybhakuni / download.ts
Created March 6, 2019 08:17
Download File Using angular
this.httpClient.get('https://angular.io/assets/images/logos/angular/angular.svg', { responseType: 'blob'})
.subscribe(data => {
console.log("data", data);
var url = window.URL.createObjectURL(data);
let downloadLink = document.createElement('a');
downloadLink.href = url
downloadLink.setAttribute('download', "file");
downloadLink.click();
});
@digvijaybhakuni
digvijaybhakuni / sample.sql
Last active September 28, 2018 10:06
SQL
-- Get All the unique name from employee
select name from employees group by name having count(name) = 1;
select name, count(name) from employees group by name having count(name) = 1;
-- Get All the unique name from employee
select name, count(name) from employees group by name having count(name) > 1;
@digvijaybhakuni
digvijaybhakuni / launch.json
Created September 27, 2018 17:54
Setting File for vscode to setup python environment
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
@digvijaybhakuni
digvijaybhakuni / App.java
Created August 27, 2018 14:56 — forked from thomasdarimont/App.java
Secure REST API Example with Spring Security, Spring Session, Spring Boot
package demo;
import java.io.Serializable;
import java.security.Principal;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
const test = [1, 2, 3];
for(const t of test){
t
}
console.log(test);
const iterator = test[Symbol.iterator]()
iterator
console.log(iterator.next());
console.log(iterator.next());
private String getLast4DigitMasking1(String str) {
final char[] chars = str.toCharArray();
for(int i = 0; i < chars.length - 4; i++){
chars[i] = '*';
}
return String.valueOf(chars);
}
@digvijaybhakuni
digvijaybhakuni / mysql_json.log
Created January 1, 2018 17:35
Basic Query On JSON Datatype | Mysql
mysql> use test;
mysql> create table sample_json(id INT, data JSON);
Query OK, 0 rows affected (0.03 sec)
mysql> describe sample_json;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| data | json | YES | | NULL | |
@digvijaybhakuni
digvijaybhakuni / DGPShazz.json
Last active October 27, 2017 08:24
DGPShazz,json
{
"black": "#2b2b2b",
"dark_blue": "#6d9cbe",
"dark_green": "#a5c261",
"dark_cyan": "#519f50",
"dark_red": "#da4939",
"dark_magenta": "#b6b3eb",
"dark_yellow": "#ffc66d",
"gray": "#42DF01",
"dark_gray": "#afff81",
@digvijaybhakuni
digvijaybhakuni / persistence.xml
Created June 17, 2017 17:41 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->