Skip to content

Instantly share code, notes, and snippets.

View gyandeeps's full-sized avatar

Gyandeep Singh gyandeeps

View GitHub Profile
@gyandeeps
gyandeeps / .zshrc
Last active July 11, 2022 19:29
Git alias for zshrc file
# Global variables
re='^[0-9]+$'
jira_name="MINT"
# Will create a new branch with name ($1) from master
# it will also make sure master is up to date from origin
workstartFunc() {
if ! [[ $1 =~ $re ]]
then
val=$1
@gyandeeps
gyandeeps / async-await.js
Created March 4, 2021 19:21
async await
const delay = (data) => new Promise((resolve) => setTimeout(resolve.bind(null, data), 100))
const delayFail = (data) => new Promise((resolve, reject) => setTimeout(reject.bind(null, data), 100))
const asyncFunc = async (x = 0) => {
console.log(await delay(x + 22));
console.log(await delay(x + 21));
console.log(await delayFail(x + 20));
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.DecimalFormat;
public class Main
{
public static void main(String[] args) throws IOException
@gyandeeps
gyandeeps / patio-project.md
Last active August 11, 2020 17:19
Patio project 2020-21

Retaining wall

Blocks

wall length = 60 ft = 720 inches

wall height = 25 inches including wall cap

since first layer will be 3 inch under the group level.

@gyandeeps
gyandeeps / profiles.json
Last active September 21, 2020 19:00
Windows Terminal Profile
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{e4f9ad07-b8dd-4267-b05f-ba1bee15339e}",
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"initialCols": 140,
"initialRows": 42,
"profiles": {
@gyandeeps
gyandeeps / jira-client.d.ts
Created October 16, 2018 20:15
Types for jira-client npm module
declare module "jira-client" {
import * as request from "request";
import { ReadStream } from "fs";
namespace JiraApi {
interface JiraApiOptions {
/** What protocol to use to connect to jira? Ex: http|https (default: http) */
protocol?: string; // optional
/** What host is this tool connecting to for the jira instance? Ex: jira.somehost.com () */
host?: string; //
[user]
name = Gyandeep Singh
email = gyandeeps@gmail.com
signingkey = <ssh key>
[push]
default = current
[core]
autocrlf = input
sshCommand = "ssh -i ~/.ssh/id_ed25519"
[includeIf "gitdir:~/magic-pixel/"]
@gyandeeps
gyandeeps / run.js
Last active April 17, 2018 13:56
Parallel run test for ESLint
const workerFarm = require("worker-farm");
const FARM_OPTIONS = {
maxConcurrentWorkers : require('os').cpus().length
, maxCallsPerWorker : Infinity
, maxConcurrentCallsPerWorker : 1
};
const workers = workerFarm(FARM_OPTIONS, require.resolve("./worker"));
let ret = 0;
@gyandeeps
gyandeeps / OneDriveBackup.bat
Created June 23, 2017 18:05
Windows backup into One Drive
robocopy %userprofile%\Documents "%userprofile%\OneDrive" /MIR /W:5 /r:5 /xo /xf *.pst /xd node_modules
@gyandeeps
gyandeeps / flexbox.less
Created February 8, 2017 01:28
Less mixin for Flexbox (IE 10+)
// --------------------------------------------------
// Flexbox LESS mixins
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-moz-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox