Skip to content

Instantly share code, notes, and snippets.

View ishanjain28's full-sized avatar
🎯
Focusing

Ishan Jain ishanjain28

🎯
Focusing
View GitHub Profile
function generateRandomString(length) {
var string = "";
var possibleValues = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for(var i = 0; i < length; i++) {
string += possibleValues.charAt(Math.floor(Math.random() * possibleValues.length));
}
return string;
}
@ishanjain28
ishanjain28 / calc.py
Created February 17, 2017 10:15
Simple GUI Calculator made with Python
from PyQt4 import QtGui
import sys
import math
class Calc(QtGui.QMainWindow):
def __init__(self):
super(Calc, self).__init__()
self.DrawLayout()
@ishanjain28
ishanjain28 / student-placement.py
Created February 17, 2017 11:21
An Application to keep Placement Records. It takes Username, Email, Mobile Number, percentage in 12th Standard and Branch and then saves it in a text file and a CSV File and also stores Email IDs in a seperate file Made in a python work shop in College
from PyQt4 import QtGui
import sys
import math
class Placement(QtGui.QMainWindow):
def __init__(self):
super(Placement, self).__init__()
self.DrawLayout()
@ishanjain28
ishanjain28 / color-to-grayscale.go
Created April 24, 2017 06:10
This Go Program Convert a colored image to a grayscaled version of that image using various algorithims.
package main
import (
"os"
"log"
"image/png"
"fmt"
"image"
"image/color"
"math"
@ishanjain28
ishanjain28 / golang-tls.md
Created July 11, 2017 13:14 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@ishanjain28
ishanjain28 / bsnl-circles-list.json
Created July 24, 2017 19:16
A list of All Telecom circles and circle codes that BSNL Uses.
[
{
"CIRCLE_NAME":"Andaman & Nicobar",
"CIRCLE_CODE":"AN",
},
{
"CIRCLE_NAME":"Andhra Pradesh",
"CIRCLE_CODE":"AP",
},

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

package db
func Init() (*mgo.Session, error) {
db, err := mgo.Dial("localhost:27017")
if err != nil {
return nil, err
}
return db, nil
}
@ishanjain28
ishanjain28 / nginx
Last active September 5, 2017 22:13
# nginx reverse proxy configuration for hosting two websites on one server
# File has to be saved in /etc/nginx/sites-available/website
# Then link it and store that in ../sites-enabled
# Also this configuration can be used to enable https on a website, Remove the third server {} block.
server {
# Redirect from http to https
listen 80;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
This file has been truncated, but you can view the full file.
[
{
"deal_date": "06/09/2017",
"security_code": "534691",
"company": "COMCL",
"client_name": "VINOD VRAJLAL NIRMAL",
"deal_type": "S",
"quantity": "6575",
"price": "32.30"
},