Skip to content

Instantly share code, notes, and snippets.

View mhtocs's full-sized avatar
🌱
learning

Arvind M. mhtocs

🌱
learning
  • Zoho
  • Chennai
View GitHub Profile
@mhtocs
mhtocs / io.cpp
Created February 25, 2017 04:48
Fast I/O in C/C++
/*
grab the whole line
char a[100];
cin.getline(a,100);
scanf("%[^\n]",a);
gets(a);
*/
inline void fastRead_int(int *a)
{
@mhtocs
mhtocs / buglife.cc
Created February 25, 2017 05:07 — forked from zsrinivas/buglife.cc
spoj 3377. A Bug’s Life | BUGLIFE
#include <bits/stdc++.h>
using namespace std;
#define usingcincout ios::sync_with_stdio(0);cin.tie(0);
template <class T>
void gint(T& n) {
n = 0;
int sign=1;
register char c=0;
while(c<33)
@mhtocs
mhtocs / fastIO.cpp
Last active February 25, 2017 05:18
Fast I/O in cpp (for Enormous Dataset on spoj)
#include <bits/stdc++.h>
using namespace std;
#define usingcincout ios::sync_with_stdio(0);cin.tie(0);
template <class T>
void getInt(T& n) {
n = 0;
int sign=1;
register char c=0;
while(c<33)
@mhtocs
mhtocs / 0_reuse_code.js
Created February 26, 2017 04:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mhtocs
mhtocs / base.gl.cpp
Created April 21, 2018 20:35 — forked from kopiro/base.gl.cpp
OpenGL base C++ project
#include <iostream>
#include <cmath>
#include <GL/glut.h>
#include <GL/glu.h>
#include <GL/gl.h>
void renderScene() // this function is called when you need to redraw the scene
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); // clear the scene
But soft! What light through yonder window breaks?
It is the east, and Juliet is the sun.
Arise, fair sun, and kill the envious moon,
Who is already sick and pale with grief,
@mhtocs
mhtocs / README.md
Created July 12, 2018 18:03
How to integrate django and mongodb using djongo

pipenv install djongo

add this to settings.py

DATABASES = {
    'default': {
        'ENGINE': 'djongo',
        'ENFORCE_SCHEMA': True,
 'NAME': 'db-name',
@mhtocs
mhtocs / create.md
Last active September 11, 2019 17:04
Create database & user postgres

To Create

$ sudo -u postgres psql
psql=# CREATE DATABASE campus_ambassador;
psql=# CREATE USER admin WITH ENCRYPTED PASSWORD 'admin123';
psql=# GRANT ALL PRIVILEGES ON DATABASE campus_ambassador TO admin;

To Drop

#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@mhtocs
mhtocs / Table.md
Last active September 13, 2018 11:03
<!DOCTYPE html>

<html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> <s