Skip to content

Instantly share code, notes, and snippets.

View chirag-shinde's full-sized avatar
💾
learning, unlearning & relearning!

Chirag Shinde chirag-shinde

💾
learning, unlearning & relearning!
View GitHub Profile
@chirag-shinde
chirag-shinde / uploadMethodOne.php
Created October 23, 2015 13:09
PHP Script to Upload CSV to MongoDB. Method One of Two.
<?php
//Your Database Connection include file here.
//This Entire PHP part can be placed in a seperate action file
//Upload File
if (isset($_POST['submit'])) {
//Upload Directory path.
$uploaddir = 'uploads/';
//FilePath with File name.
$uploadfile = $uploaddir . basename($_FILES["filename"]["name"]);
@chirag-shinde
chirag-shinde / rock_paper_scissor_rope.js
Last active August 29, 2015 14:26
CodeAcademy's JavaScript Rock,Paper,Scissors, Rope. This does all the 3, check the user's input, added choice of rope, in case of a tie it asks users or new input.
var choice = function()
{
var userChoice = prompt("Select rock, paper, scissors,rope");
if(userChoice!=="rock" && userChoice!=="paper" && userChoice!=="scissors" && userChoice!=="rope")
{
alert("You have entered wrong choice, enter rock, paper, scissors or rope");
choice();
}
else{
var computerChoice = Math.random();