Skip to content

Instantly share code, notes, and snippets.

View kranthilakum's full-sized avatar
🚀
Focusing

Kranthi Lakum kranthilakum

🚀
Focusing
View GitHub Profile
@kranthilakum
kranthilakum / social.html
Last active December 19, 2015 05:19
My Social Links using Font-Awesome and Twitter Bootstrap
<!DOCTYPE HTML>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet"/>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"/>
.social ul{
list-style-type: none;
margin: 0;
padding: 0;
}
@kranthilakum
kranthilakum / rename_files.py
Last active February 17, 2023 03:51
Python script to replace underscores with spaces
#!/usr/bin/python
# Usage: python rename_files.py "C:\Directory of Files with Underscores"
import os
import sys
directory = sys.argv[1] # parse through file list in the current directory
for filename in os.listdir(directory): # parse through file list in the current directory
@kranthilakum
kranthilakum / angular-example.js
Last active January 4, 2016 16:09
Angular.js: service vs provide vs factory
var myApp = angular.module('myApp', []);
// a simple service
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};
});
// a simple factory
@kranthilakum
kranthilakum / angular-example-2.html
Created January 27, 2014 09:39
AngularJS service, factory, provider
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.0.1/angular.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="MyCtrl">
{{serviceOutput}}
<br/><br/>
@kranthilakum
kranthilakum / angular-directive-example.md
Last active January 4, 2016 16:19
Simple example to illustrate Angular directive
// Set image as background of a div element using CSS
.fill-bg {
  background-img: url('MYURLHERE');
  background-size : 'cover';
  background-repeat : 'no-repeat';
  background-position : 'center center';
}

/* Automate the above process using jquery, so that
@kranthilakum
kranthilakum / GoogleAuthService.js
Created December 5, 2016 17:46
Angular Service for Google API Authentication
// <script src="https://apis.google.com/js/client:platform.js" type="text/javascript"></script>
var app = angular.module("MyApp", []);
app.service('GoogleService', ['$q', '$http', '$log', '$window', function($q, $http, $log, $window){
var gapi = $window.gapi;
var updateSigninStatus = function(isSignedIn) {
if (isSignedIn) {
makeApiCall();
}
@kranthilakum
kranthilakum / os_guide.md
Last active April 25, 2018 01:00
Operating Systems Guide

CPU

Interrupts

CPU Registers

Memory

offsets, pointers, stack

Hard Disk

hard disk, cylinder, head, sector, carry bit

Segmentation

Boot Sector

Graphics

@kranthilakum
kranthilakum / scripts.md
Last active October 17, 2017 11:14
Scripts - Code Kata
// A lock has a three pin combination to unlock it. A program to list all possible combinations
(function() {
    var i = 0,
        j = 0,
        k = 0;
    var max = 9;
    for (i; i <= max; i++) {
        for (j = i; j <= max; j++) {
            for (k = j; k <= max; k++) {
@kranthilakum
kranthilakum / scala-for-expression.md
Last active February 17, 2018 14:19
Scala for Expression

for comprehension or for expression:

val numbers = Seq(1, 2, 3)
// numbers: Seq[Int] = List(1, 2, 3)

# single generator
for(i <- 1 to 3) print(i)
// 123
@kranthilakum
kranthilakum / web-services.md
Last active February 27, 2018 11:40
Web Services

Web Service

  • a method of communication between two devices over network
  • a collection of standards or protocols for exchanging information between two devices or application

SOAP

  • Simple Object Access protocol
  • W3C recommendation for communication between two applications
  • XML based messaging protocol
  • Platform and programming language independent