Skip to content

Instantly share code, notes, and snippets.

View deepu105's full-sized avatar
🏠
Working from home

Deepu K Sasidharan deepu105

🏠
Working from home
View GitHub Profile
export TERM="xterm-256color" # This sets up colors properly
# workaround as per https://superuser.com/questions/1222867/zsh-completion-functions-broken
FPATH=$HOME/.oh-my-zsh/plugins/git:$HOME/.oh-my-zsh/functions:$HOME/.oh-my-zsh/completions:/usr/share/zsh/site-functions:/usr/share/zsh/$ZSH_VERSION/functions
export FPATH
# set shell
export SHELL=/usr/bin/zsh
@deepu105
deepu105 / rust-ownership.rs
Created March 30, 2020 17:54
Rust ownership and lifetimes
// This function takes ownership of the passed value
fn take_ownership(value: Box<i32>) {
println!("Destroying box that contains {}", value); // value is destroyed here, and memory gets freed
}
// This function borrows the value by reference
fn borrow(reference: &i32) {
println!("This is: {}", reference);
}
@deepu105
deepu105 / VSCode-extensions
Created June 16, 2019 14:49
VSCode plugins I use
code --install-extension QassimFarid.ejs-language-support
code --install-extension SirTori.indenticator
code --install-extension TimonVS.ReactSnippetsStandard
code --install-extension TwentyChung.jsx
code --install-extension abusaidm.html-snippets
code --install-extension asvetliakov.move-imports
code --install-extension aws-scripting-guy.cform
code --install-extension bierner.markdown-preview-github-styles
code --install-extension ccitiriga.TSMethodCreator
code --install-extension christian-kohler.npm-intellisense
# If you come from bash you might have to change your $PATH.
export SHELL=/usr/bin/zsh
# Path to your oh-my-zsh installation.
export ZSH="/home/deepu/.oh-my-zsh"
# Lines configured by zsh-newuser-install
HISTFILE=~/.zsh_history
HISTSIZE=5000
SAVEHIST=5000
setopt autocd
application {
config {
baseName store
applicationType gateway
packageName com.okta.developer.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType postgresql
cacheProvider hazelcast
buildTool gradle
/* Store gateway application */
application {
config {
baseName store
applicationType gateway
packageName com.mycompany.store
serviceDiscoveryType eureka
authenticationType jwt
prodDatabaseType mysql
@deepu105
deepu105 / Istio-jh.json
Created March 25, 2022 08:10
JDL -> JSON
{
"applications": [
{
"config": {
"baseName": "store",
"applicationType": "gateway",
"packageName": "com.jhipster.demo.store",
"packageFolder": "com/jhipster/demo/store",
"serviceDiscoveryType": "no",
"authenticationType": "jwt",
@deepu105
deepu105 / Istio-jh.jdl
Created November 13, 2021 11:53
Istio-jh.jdl
application {
config {
baseName store
applicationType gateway
packageName com.jhipster.demo.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType postgresql
cacheProvider hazelcast
buildTool gradle
application {
config {
baseName store
applicationType gateway
packageName com.jhipster.demo.store
serviceDiscoveryType no
authenticationType jwt
prodDatabaseType mysql
cacheProvider hazelcast
buildTool gradle
@deepu105
deepu105 / rust-stack-vs-heap.rs
Created March 30, 2020 17:55
Rust stack vs heap usage
use std::fs::File;
use std::io::prelude::*;
use std::usize;
fn lookup_ptr(addr: usize) -> std::io::Result<Option<String>> {
let mut contents = String::new();
File::open("/proc/self/maps")?.read_to_string(&mut contents)?;
Ok(contents
.split("\n")
// Uncomment this if you are only interested in stack and heap