Skip to content

Instantly share code, notes, and snippets.

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

Pradeep Chhetri chhetripradeep

🏠
Working from home
View GitHub Profile
Sub blah()
Dim rng As Range
With ActiveSheet
With Intersect(.UsedRange, .Range("B:BZ"))
.Value = .Value
For Each cll In .Cells
If Len(cll.Value) = 0 Then Set rng = Union(cll, IIf(rng Is Nothing, cll, rng))
Next cll
End With
End With
Sub parser()
Dim N As Long, wf As WorksheetFunction
Set wf = Application.WorksheetFunction
N = Cells(Rows.Count, "A").End(xlUp).Row
Dim i As Long, j As Long, k As Long
For i = 1 To N
ary = Split(wf.Trim(Cells(i, "A").Text), " ")
k = 2
For j = LBound(ary) To UBound(ary)
Cells(i, k).Value = ary(j)
Public Function check(text As String) As Boolean
Dim reg As Object
Set reg = CreateObject("vbscript.regexp")
Dim reg1 As Object
Set reg1 = CreateObject("vbscript.regexp")
reg.Pattern = "^[a-zA-Z][0-9]+$"
reg1.Pattern = "^TP[0-9]+$"
@chhetripradeep
chhetripradeep / main.go
Created January 7, 2018 17:09 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@chhetripradeep
chhetripradeep / 11-cassandra-filter.conf
Created January 10, 2018 11:48 — forked from ibspoof/11-cassandra-filter.conf
Grok Patterns and configuration for Cassandra logs
filter {
if [type] == "cassandralog" {
grok {
break_on_match => true
match => {
"message" => [
"%{CASS_COMPACTION_LARGE_KEY}",
"%{CASS_SLAB_POOL_CLEANER_1}",
"%{CASS_SLAB_POOL_CLEANER_2}",
resource "aws_iam_group_policy" "my_developer_policy" {
name = "my_developer_policy"
group = "${aws_iam_group.my_developers.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [

Windows

  1. Download & install the Windows OpenVPN Client

  2. Extract the configuration (sent to you over email) inside C:\Program Files\OpenVPN\config directory

  3. Run Command Prompt as Administrator.

def concat_basic(iterations):
output = ""
for num in range(iterations):
output += str(num)
return output
def concat_join(iterations):
output = []
for num in range(iterations):
output.append(str(num))
return "".join(output)