Skip to content

Instantly share code, notes, and snippets.

View ganesshkumar's full-sized avatar
⌨️
Click. Clack. Click. Click.

Ganessh Kumar ganesshkumar

⌨️
Click. Clack. Click. Click.
View GitHub Profile
abacus,frame with balls for calculating
abate,to lessen to subside
abdication,giving up control authority
aberration,straying away from what is normal
abet,help/encourage smb (in doing wrong)
abeyance,suspended action
abhor,to hate to detest
abide,be faithful to endure
abjure,promise or swear to give up
abraded,rubbed off worn away by friction
@ganesshkumar
ganesshkumar / Facebook Assistant.md
Last active August 29, 2015 14:06
💡 Ideas 💡

#Facebook Assistant#

Social networks have become an integrated part of most of us. I am one of those people who can't just quit facebook because there are few groups I don't want to miss out, few pages and people I follow.

My likes

  • Groups
    • My college technology club
    • Coursera study groups
    • My Professor's group
  • My dota2 clan
@ganesshkumar
ganesshkumar / LonelyIntegers
Last active January 2, 2016 00:58
My pythonic solution to 'Lonely Integer' problem on Hacker Rank (https://www.hackerrank.com/challenges/lonely-integer)
#!/usr/bin/py
# Head ends here
def lonelyinteger(a):
answer = 0
for number in a:
answer = answer ^ number
return answer
# Tail starts here
if __name__ == '__main__':
a = input()
@ganesshkumar
ganesshkumar / KruskalMST.java
Created July 27, 2016 23:24
Kruskal's Minimum Spanning Tree using Java Stream
package greedy;
import java.util.*;
import java.util.stream.IntStream;
/**
* Created by ganessh on 28/07/16.
*/
class Edge {
private int source;
@ganesshkumar
ganesshkumar / webview.lua
Created November 30, 2016 21:34
Hammerspoon
function showBrowser()
local wv = hs.webview.new(hs.screen.primaryScreen():frame())
wv:url("http://www.google.com"):windowStyle({"titled", "closable", "resizable"}) :show()
-- bring the webview to front
hs.application.get("Hammerspoon"):activate()
end
import click
class Config(object):
def __init__(self):
self.verbose = False
pass_config = click.make_pass_decorator(Config, ensure=True)
@click.group()
@click.option('--verbose', is_flag=True)
@ganesshkumar
ganesshkumar / environmental_variables.rb
Created January 18, 2017 09:02
Jekyll plugin to load environmental variables
module Jekyll
class EnvironmentVariablesGenerator < Generator
def generate(site)
site.config['title'] = ENV['TITLE']
site.config['description'] = ENV['DESCRIPTION']
site.config['twitter'] = ENV['TWITTER_USERNAME']
site.config['github'] = ENV['GITHUB_USERNAME']
site.config['linkedin'] = ENV['LINKEDIN_PUBLIC_ID']
@ganesshkumar
ganesshkumar / applicaion-access-keys-calls..js
Created October 3, 2017 11:54
Making MitterIO App Access Key API calls with Postman
// Setup your headers this way (it'd be better if you used Presets for this)
//
// X-Application-Access-Key : {{mitter_appAccessKey}}
// Content-Type : application/json
// Date : {{mitter_requestDate}}
// Nonce : {{mitter_requestNonce}}
// Content-MD5 : {{mitter_requestPayloadMd5}}
// Authorization : {{mitter_requestAuthorization}}
// Then add the following script as a pre-request script (you will have to create a new environment

I am following this post,Build a Serverless Golang Function with OpenFaaS , to create a function in go.

You can find my function to generate identicon on Github.

  • Make sure you are using the branch go-template if you are cloning the repo.
  • The master brach is a standalone repo and it is not based on go template.

Setting up the fuction

Switch to your function folder

$ cd $FUNCTIONS_FOLDER
@ganesshkumar
ganesshkumar / python-afterburn.md
Created December 22, 2017 13:53
OpenFaaS python afterburn template loadtest

Running the watchdog locally

➜  python-afterburn git:(master) ✗ mode=afterburn fast_fork=1 port=8081 fprocess="python2 index.py" fwatchdog
2017/12/22 19:19:39 OperationalMode: AfterBurn
Forking - python2 [index.py]
2017/12/22 19:19:39 Started logging stderr from function.
2017/12/22 19:19:39 Writing lock file at: /var/folders/q2/b6ph5sg17yx855gl6hzp7ypm0000gn/T/.lock