Skip to content

Instantly share code, notes, and snippets.

Madhusudhan Srinivasa madhums

Block or report user

Report or block madhums

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@madhums
madhums / base64-image-upload.js
Created Sep 14, 2014
save base64 encoded image
View base64-image-upload.js
/*
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674
*/
var fs = require('fs');
// string generated by canvas.toDataURL()
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0"
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO"
+ "3gAAAABJRU5ErkJggg==";
// strip off the data: url prefix to get just the base64-encoded bytes
@madhums
madhums / gin_html_render.go
Last active Aug 29, 2019
render html templates in gin (go)
View gin_html_render.go
// Package GinHTMLRender provides some sugar for gin's template rendering
//
// This work is based on gin contribs multitemplate render https://github.com/gin-gonic/contrib/blob/master/renders/multitemplate
//
// Usage
//
// router := gin.Default()
//
// // Set html render options
// htmlRender := GinHTMLRender.New()
@madhums
madhums / docker-compose.yml
Created Aug 15, 2019
docker with nginx and php-fpm
View docker-compose.yml
version: '3.3'
services:
php:
image: php:7.1-fpm
volumes:
- .:/var/www/html
working_dir: /var/www/html
networks:
- web
@madhums
madhums / install-android-emulator-brew-macos.md
Created Jul 9, 2019
installing android emulator using cli on a mac
View install-android-emulator-brew-macos.md

In your command line

brew cask install android-sdk
sdkmanager "emulator"
sdkmanager "platform-tools"
sdkmanager "system-images;android-26;google_apis;x86_64"
avdmanager create avd -n NAME -k "system-images;android-26;google_apis;x86_64" # the one that you use above
View keybase.md

Keybase proof

I hereby claim:

  • I am madhums on github.
  • I am madhums (https://keybase.io/madhums) on keybase.
  • I have a public key ASBVMIs9eqWnfu0aNDPJA5_wKDQv66UV2VaW4wuo7Ev5VQo

To claim this, I am signing this object:

@madhums
madhums / expressjs-base64-image.js
Created Mar 9, 2012 — forked from hackable/expressjs-base64-image.js
Node.js base64 encode a downloaded image for use in data URI
View expressjs-base64-image.js
express = require("express")
request = require("request")
BufferList = require("bufferlist").BufferList
app = express.createServer(express.logger(), express.bodyParser())
app.get "/", (req, res) ->
if req.param("url")
url = unescape(req.param("url"))
request
uri: url
encoding: 'binary'
@madhums
madhums / graphql-go-mongodb-example.go
Created May 6, 2019 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
View graphql-go-mongodb-example.go
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@madhums
madhums / dc-movies-in-order.md
Created Apr 27, 2019
dc movies to watch in order
View dc-movies-in-order.md

DC Movies in order

  1. Man of Steel (2013)
  2. Dawn of Justice (2016)
  3. Suicide Squad (2016)
  4. Wonder Woman (2017)
  5. Justice League (2017)
  6. Aquaman (2018)
  7. Shazam! (2019)
@madhums
madhums / marvel-movies-in-order.md
Created Apr 27, 2019
marvel movies to watch in order
View marvel-movies-in-order.md

Marvel movies in order

  1. Iron Man
  2. The Incredible Hulk
  3. Iron Man 2
  4. Thor
  5. Captain America
  6. Avengers
  7. Iron Man 3
  8. Thor: The Dark World
You can’t perform that action at this time.