Distribution of outcomes: { '0': 81, '1': 108, '2': 54, '3': 12, '4': 1 }
Total number of outcomes: 256
Probability for each outcome: { '0': 0.31640625,
'1': 0.421875,
'2': 0.2109375,
'3': 0.046875,
'4': 0.00390625 }
Total probability: 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", | |
"profiles": |
I hereby claim:
- I am ganesshkumar on github.
- I am ganesshkumar (https://keybase.io/ganesshkumar) on keybase.
- I have a public key ASCPzCuZBtabtgLqt7MPL7MFhUzbdcDf7RABPWAZ3RvVHgo
To claim this, I am signing this object:
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
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.
Switch to your function folder
$ cd $FUNCTIONS_FOLDER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package greedy; | |
import java.util.*; | |
import java.util.stream.IntStream; | |
/** | |
* Created by ganessh on 28/07/16. | |
*/ | |
class Edge { | |
private int source; |
NewerOlder