Skip to content

Instantly share code, notes, and snippets.

View GnsP's full-sized avatar
👽
avant-garde

Ganesh Prasad GnsP

👽
avant-garde
View GitHub Profile
@GnsP
GnsP / .vimrc
Created July 22, 2021 06:00
my vimrc
" vim-bootstrap b990cad
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
" vim-bootstrap b990cad
"*****************************************************************************
"" Vim-PLug core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
endif
let vimplug_exists=expand('~/.vim/autoload/plug.vim')
@GnsP
GnsP / docker-clean.sh
Created March 9, 2018 06:57
Clean docker space for mac osx
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs docker volume rm
@GnsP
GnsP / vdom.is
Last active July 21, 2017 11:30
VirtualDOM implementation in Ironscript
_sync "VDOM : The Virtual DOM implementation in Ironscript"
(_include "stdlib")
[defun h (type props :children) {
[.props = props]
[parse-type-string = @{
var type = args[0];
var idDelim = args[1];
<?php
phpinfo();
?>
# create a local bin
mkdir -p ~/bin
# link python2 as default python in local bin and export the path (must for Ubuntu 16.04)
ln -s ${which python2} ~/bin/python
export PATH=~/bin:$PATH
# create node_env directory and setup the virtualenv there, activate that
mkdir -p ~/node_env
@GnsP
GnsP / hrml.cpp
Created January 24, 2016 14:57
Solution to AttributeParser problem on Code.Cpp3 contest (HackerRank)
#include <cmath>
#include <cstdio>
#include <vector>
#include <map>
#include <utility>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
@GnsP
GnsP / tictactoe_simple.cpp
Created November 16, 2015 17:41
TicTacToe game written during my 1st year at NITR
#include <iostream>
#include <cctype>
using namespace std;
class board{
public:
board(){
for(int i=0; i<3; i++)
for(int j=0; j<3; j++)
mat[i][j] = ' '; // initially all cells are blank space
@GnsP
GnsP / festiveCities.cpp
Created October 2, 2015 21:57
Another problem from a placement test, based on modified BFS, done for a friend.
#include <iostream>
#include <vector>
#include <queue>
#define INF 1000000007
using namespace std;
typedef vector<vector<int> > graph;
void updateDist(graph &g, vector<int> &dist, int src){
queue<int> q;
@GnsP
GnsP / snake_dp.cpp
Created October 2, 2015 21:05
Snake game DP problem given in some placement test I did for a friend XD
#include <iostream>
#include <algorithm>
#define INF 1000000007
using namespace std;
int dp[505][505][2]; // the storage for the DP (Dynamic programming)
int grid[505][505]; // the storage for the actual grid
void init(int n, int m){ // read from input and initialize the grid and
for(int i=0; i<n; i++){ // the DP arrays.