Skip to content

Instantly share code, notes, and snippets.


Sarath C sharat

View GitHub Profile
sharat /
Created Apr 17, 2019
Bash script to upgrade brew, npm global packages, ruby gems and Cocoapods
echo "Upgrading Brew Packages"
brew upgrade
brew cleanup
echo "Upgrading Global NPM Packages"
npm upgrade -g
echo "Upgrading Gems installed"
gem update
gem cleanup

Keybase proof

I hereby claim:

  • I am sharat on github.
  • I am sarat ( on keybase.
  • I have a public key ASCpGYABrDuEUseVITGhBcuQttuLgnVIUdMBtI1yIRQF7Qo

To claim this, I am signing this object:

sharat / slack-sidebar-themes
Last active Jun 26, 2018
Slack Sidebar Colors - Visual Studio Code Dark
View slack-sidebar-themes
# VS Code Dark theme default
# Visual Studio Mac Light
# Microsoft Docs
sharat /
Created Jun 25, 2018
List the process owns a given port
# Change 80 to your desired port.
# Use Sudo as appropriate
sudo lsof -i :80
sharat / format-time-interval-swift.swift
Last active Aug 31, 2019
Format time Interval to hour, minute, second format using Swift
View format-time-interval-swift.swift
extension TimeInterval {
func stringFormatted() -> String {
let interval = Int(self)
let seconds = interval % 60
let minutes = (interval / 60) % 60
let hours = (interval / (60*60)) % 60
return String(format: "%02d:%02d:%02d", hours, minutes, seconds)
View UITextField-Bottom-Border.swift
extension UITextField {
func useUnderline() -> Void {
let border = CALayer()
let borderWidth = CGFloat(2.0) // Border Width
border.borderColor =
border.frame = CGRect(origin: CGPoint(x: 0,y :self.frame.size.height - borderWidth), size: CGSize(width: self.frame.size.width, height: self.frame.size.height))
border.borderWidth = borderWidth
self.layer.masksToBounds = true
sharat / kue-list.js
Created Apr 21, 2017
Lists all jobs in Kue
View kue-list.js
var kue = require('kue');'Creating Queue with redis', process.env.REDISCLOUD_URL);
var queue = kue.createQueue({
redis: process.env.REDISCLOUD_URL
console.log('moving forward with kue')
sharat /
Last active Dec 15, 2016
When you local repository fails to remove invalid remote referneces
# The symptoms. When you do this, you keep on getting new and deleted branches all the time
git remote update
git pull
# Symptom 2 (for obvious reasons).
git branch -a --merged # Check the merged branches
git push origin --delete [branch name] # this complains remote doesn't exist
# The remedy
import json
import logging
import os
import socket
import ssl
import struct
import sys
import time
import uuid
sharat /
Created Jul 27, 2015
create IPK file using xctool (xcrun)
set -x
# codesigning and provisioning profile should be configured using Xcode
PROJECT=<your project name>
SCHEME=${PROJECT} # Setting project name as the default scheme. Update based on your scheme
You can’t perform that action at this time.