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
import logging | |
class CustomFormatter(logging.Formatter): | |
grey = "\x1b[38;20m" | |
yellow = "\x1b[33;20m" | |
red = "\x1b[31;20m" | |
bold_red = "\x1b[31;1m" | |
green = "\x1b[38;2;0;255;0m" | |
sky_blue = "\x1b[38;2;135;206;235m" |
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
param ( | |
[string]$COMMIT_MSG_FILE, | |
[string]$COMMIT_SOURCE, | |
[string]$SHA1 | |
) | |
# Get the current branch name | |
$BRANCH_NAME = (git rev-parse --abbrev-ref HEAD 2>$null) | |
# Ensure BRANCH_NAME is not empty and is not in a detached HEAD state (i.e. rebase). |
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/sh | |
# | |
# Inspects branch name and checks if it contains a Jira ticket number (i.e. ABC-123). | |
# If yes, commit message will be automatically prepended with [ABC-123]. | |
# | |
# Useful for looking through git history and relating a commit or group of commits | |
# back to a user story. | |
# | |
COMMIT_MSG_FILE=$1 |
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
local cmd = vim.cmd | |
cmd 'packadd paq-nvim' | |
local paq = require('paq-nvim').paq | |
paq{'savq/paq-nvim', opt=true} | |
paq {'nvim-treesitter/nvim-treesitter', run=':TSUpdate'} | |
paq {'nvim-treesitter/playground'} | |
paq {'neovim/nvim-lspconfig'} |
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
// based on https://boyter.org/posts/file-read-challange/?utm_medium=email&utm_source=topic+optin&utm_campaign=awareness&utm_content=20190511+prog+nl&mkt_tok=eyJpIjoiWTJNMU16UTJZekU0T1dZeCIsInQiOiJqWnNJYkhxYWJBbklUcEFDTmQxdVh4OHVhREliRE5LcFlQa0hCRjRnSlg2SzZ2MFF4VVhDTGZlNEJDUlwvOXZkeXBkOTFHUFNYOEh4N2pvVWExTWppTWhQRm50ZzRaNkdOb2ErZjI2THRKZXNhN1BHcGcyams1S0pFZitLcjZwUEwifQ%3D%3D | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.util.*; | |
import java.util.concurrent.ArrayBlockingQueue; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.function.Function; |
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
public class X { | |
public static final int safeAdd(int left, int right){ | |
if (right > 0? left > Integer.MAX_VALUE - right: left < Integer.MIN_VALUE - right) { | |
// throw new ArithmeticException("Integer overflow"); | |
} | |
return (left + right); | |
} | |
} |
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
set lines=100 | |
set columns=133 | |
" Enable debugging | |
" let g:ycm_keep_logfiles = 1 | |
" let g:ycm_log_level = 'debug' | |
let g:tags_path = "/home/rohits/.ctags.d,/usr/lib/python3/dist-packages/Tags" | |
set tags=./tags,../tags,../inc/tags |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
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
# http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/ | |
# http://stackoverflow.com/questions/83410/how-do-i-call-a-sql-server-stored-procedure-from-powershell | |
# http://everythingsharepoint.blogspot.com/2011/08/call-sql-stored-procedure-from.html | |
$dataSource = "$env:COMPUTERNAME\VIM_SQLEXP" | |
$database = “VIM_VCDB” | |
$connectionString = “Server=$dataSource;Database=$database;Integrated Security=True;” | |
# write-host $connectionString | |
$connection = New-Object System.Data.SqlClient.SqlConnection | |
$connection.ConnectionString = $connectionString |
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
const http = require ('https') | |
var options = { | |
host: '127.0.0.1', | |
port: 443, | |
path: '/admin/resources/fix_packs', | |
// path: '/admin/resources/change_plans', | |
auth: 'admin:admin', | |
method: 'GET', | |
headers: { | |
'X-IBM-Workload-Deployer-API-Version': '5.0', |
NewerOlder