Skip to content

Instantly share code, notes, and snippets.

View rishpandey's full-sized avatar
🎯
Focusing

Rishabh Pandey rishpandey

🎯
Focusing
View GitHub Profile
@rishpandey
rishpandey / Test.java
Created July 7, 2016 05:44
Calculate Execution time
public class Test {
public static void main(String[] args) {
long startTime = System.nanoTime();
\\ Logic Here
long stopTime = System.nanoTime();
long elapsedTime = stopTime - startTime;
@rishpandey
rishpandey / library.c
Created January 24, 2017 16:23
Library Management in C
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#define MAX 100
#define EXIT_CHOICE 10
#define USERS_FILE "users.txt"
#define BOOKS_FILE "books.txt"
cat source.csv | awk 'BEGIN{ FS=" *;"; OFS=";" } {$1=$1; print $0}' >> targetfile
package problems;
import java.util.Scanner;
import java.util.regex.Pattern;
public class StringConvertor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int totalInputs = Integer.parseInt(scanner.nextLine());
package problems;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Scanner;
public class FileAppender {
public static void main(String[] args) {
InputStream in = System.in;
Scanner scanner = new Scanner(in);
@rishpandey
rishpandey / Instructions.txt
Created February 23, 2018 07:08
Larvel all routes 404 fix
[Optional] Set DocumentRoot
nano /etc/apache2/sites-available/000-default.conf
Set AllowOverride in /etc/apache2/apache2.conf
Under /var/www :
AllowOverride All
Allow rewrite
sudo a2enmod rewrite
@rishpandey
rishpandey / README-Template.md
Created April 2, 2018 06:48 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

[
{ "keys": ["super+k", "super+shift+x"], "command": "destroy_pane", "args": {"direction": "self"} },
{ "keys": ["super+shift+u"], "command": "find_use" },
]
@rishpandey
rishpandey / test.php
Last active May 20, 2019 14:21
Phpinfo test script
<?php
echo phpinfo();
@rishpandey
rishpandey / basic_curl.php
Created May 20, 2019 14:18
php curl example
<?php
$ch = curl_init("http://www.example.com/");
$fp = fopen("example_homepage.txt", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);