Skip to content

Instantly share code, notes, and snippets.

View vmiheer's full-sized avatar

miheer vaidya vmiheer

View GitHub Profile
@vmiheer
vmiheer / DeleteOutlookEvents.ps1
Created February 1, 2017 09:17
Mass delete outlook calender events by subject
$eventSubject = "Subject of event" # replace me with another Subject
$olFolderCalendar = 9
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNamespace('MAPI')
$calender = $namespace.GetDefaultFolder($olFolderCalendar) #
$totalEvents = ($calender.Items | where { $_.Subject -eq $eventSubject}).Count
if ($totalEvents) {
(($calender.Items | where { $_.Subject -eq $eventSubject } )[1..$totalEvents]) | % { $_.Delete() }
}
@vmiheer
vmiheer / p4sync.ps1
Last active July 22, 2016 07:28
better p4 sync
function Sync-Perforce($Path)
{
Write-Host $Path
$arguement = "$($Path)/...";
p4 sync $arguement 1>$null 2>&1;
if ($LASTEXITCODE -ne 0) {
$output = & p4 sync $arguement 2>&1;
if ($output.CategoryInfo.TargetName -eq "Request too large (over 750000); see 'p4 help maxresults'.") {
Write-Debug "Request too large! Retrying Subdirs";
$SubDirs = &p4 dirs -C "$($Path)/*"
@vmiheer
vmiheer / links.md
Created January 16, 2016 16:19
reveal.js tricks
@vmiheer
vmiheer / winctrls.patch
Last active August 29, 2015 14:24
Use monaco font in mintty
Index: winctrls.c
===================================================================
--- winctrls.c (revision 1322)
+++ winctrls.c (working copy)
@@ -829,8 +829,8 @@
cf.hwndOwner = dlg.wnd;
cf.lpLogFont = &lf;
cf.Flags =
- CF_FIXEDPITCHONLY | CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT |
- CF_SCREENFONTS | CF_NOSCRIPTSEL;
@vmiheer
vmiheer / p4sync.sh
Last active August 29, 2015 14:15
sync p4 recursively
# we have software depot in perforce //sw/...
# problem is while syncing we get:
# Request too large (over 750000); see 'p4 help maxresults'.
# here is simple function to resolve this:
# if you are using zsh
# $ setopts interactivecomments
sync_p4 ()
{
p4 -r 1 sync $1...$2; # sync $1 at $2 ; possible $2's can be #0 ;) or @my-cl-number
# retry only once
git config --global user.name "<name>"
git config --global user.email "<email>"
cat ~/.gitconfig
mkdir git-demo
cd git-demo
git init
touch hello.txt
git add .
git commit -a
vi hello.txt
@vmiheer
vmiheer / rails_installation_ubuntu
Created March 31, 2012 14:13 — forked from techmaniack/rails_installation_ubuntu
Setting up RAILS on Ubuntu
STEP 1:
$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
STEP 2:
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
STEP 3: