Skip to content

Instantly share code, notes, and snippets.

View haridas's full-sized avatar
🎯
Focusing

Haridas N haridas

🎯
Focusing
View GitHub Profile
@haridas
haridas / reduce_git_repo_size.sh
Last active January 6, 2017 04:27
Remove old files completely from git history
## How to remove the old files/folder from all git commits.
#1. clone the repo freshly
git clone <repo.git>
#2. Do index-filter option to go through all the object indexs and look for give match
# And remove those matching objects.
git filter-branch \
--prune-empty \
--index-filter \
@haridas
haridas / android_sdk_cmd.md
Last active November 24, 2016 05:18
Manage Android sdk from command line

Some times it would be very handy to check / update android sdk from command line. For automation pipelines it surely helps. Here is few commands that can be used to check or update android sdk from command line.

List Installed SDK details

haridas@haridas-HP-ProBook-4440s:~$ android list sdk
Refresh Sources:
  Fetching https://dl.google.com/android/repository/addons_list-2.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
@haridas
haridas / class_attr.py
Created January 22, 2012 18:06
Intercept Class attributes - Python
"""
Intercept class attributes, and more aboute the discriptors.
Discriptors - Assign a class object to an attribute of another class.
"""
class MetaClass(type):
#This attribute interceptor works when we call the class attributes.
def __getattribute__(self,attr):
print 'Inside Metaclass - class of a class : '
print "class: {}, attribute: {}".format(self,attr)
package main
import (
"encoding/json"
"fmt"
)
type Response struct {
Action string
Node Nodes
@haridas
haridas / tcp_server_non_blocking.c
Created April 27, 2014 13:03
TCP server with non blocking socket.
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>