Skip to content

Instantly share code, notes, and snippets.

View arya-oss's full-sized avatar
💭
I may be slow to respond.

Rajmani Arya arya-oss

💭
I may be slow to respond.
View GitHub Profile

for python interactive shell on windows in Git 2.3 onwards

python

instead write

winpty python

for simple http server

@arya-oss
arya-oss / login-signup-tabpane-popup.php
Created January 15, 2016 15:14
Login and Sign Up tabs
<!DOCTYPE html>
<html>
<head>
<title>Modal Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
@arya-oss
arya-oss / redirect.c
Created January 16, 2016 09:39
input and output redirection in unix system in c language. very helpful in Networks Programming
/**
* Author: Rajmani Arya
* Originally By: http://stackoverflow.com/users/121747/jack
*/
static int fd_in, fd_out;
static fpos_t pos_in, pos_out;
void switchStdin(const char *newStream)
{
fflush(stdin);

Apt-Get settings on ubuntu 15.10

I've seen many people got stuck at

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install <any-package>

these command despite of setting http_proxy or HTTP_PROXY. Since Ubuntu 15.10, it removed apt-get default proxy configuration. So to overcome this, create an proxy configuration file

Vim settings for ubuntu

  cd
  vi .vimrc

add these lines to opened file

set nocompatible
set expandtab
set shiftwidth=4
@arya-oss
arya-oss / gcc.sublime-build
Created April 11, 2016 16:41
GCC build option for sublime. create new build system and add following lines
{
"cmd": ["gcc", "$file", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c",
"variants":
[
{
"name": "Run",
"shell": true,
@arya-oss
arya-oss / g++.sublime-build
Created April 11, 2016 16:43
C++ build option for sublime. create new build system and add following lines
{
"cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c",
"variants":
[
{
"name": "Run",
"shell": true,
@arya-oss
arya-oss / 2048.cpp
Created August 14, 2016 20:10
2048 puzzle game
#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
int USER = 1;
int COMPUTER = 0;
#define LEFT 0
#define RIGHT 1
#define UP 2
@arya-oss
arya-oss / cns_modular_arithmetic.cpp
Created August 15, 2016 13:57
Calculate modulus of sum of to large integers with prime number
#include <iostream>
#include <string>
using namespace std;
int main () {
string num1, num2, res, len1;
cout << "Enter Number: "; cin >> num1;
cout << "Enter Number: "; cin >> num2;
int prime;
@arya-oss
arya-oss / substitution_cipher.md
Last active September 7, 2016 04:08
CNS Lab 4th day

Caesar Cipher

#include <bits/stdc++.h>
using namespace std;

#define SHIFT 3

int main(int argc, char * argv[]) {
    string str, crypt;
    cout << "Enter string: ";