Skip to content

Instantly share code, notes, and snippets.

View isauravmanitripathi's full-sized avatar
🏁
1111

saurav tripathi isauravmanitripathi

🏁
1111
View GitHub Profile
@isauravmanitripathi
isauravmanitripathi / outputbuffering.txt
Last active April 5, 2019 11:17
output buffering in php
ob_start();
print "Hello First!\n";
ob_end_flush();
ob_start();
print "Hello Second!\n";
ob_end_clean();
ob_start();
print "Hello Third\n";
// reusing buffers
@isauravmanitripathi
isauravmanitripathi / locate.php
Last active March 24, 2019 17:34
Help you to get location of your user in real time, in php
<h1>Getting your current location</h1>
<input type="button" id="go" value="click me to view your location">
<script>
$(document).ready(function () {
// wire up button click
$('#go').click(function() {
// test for presence of geolocation
if (navigator && navigator.geolocation) {
navigator.geolocation.getCurrentPosition(geo_success, geo_error);
} else {
<!DOCTYPE html>
<html>
<body>
<script>
$(document).ready(function () {
//wire up button click
$('#go').click(function () {
// test for presence of geolocation
if (navigator && navigator.geolocation) {
// make the request for the user's position
<!DOCTYPE html>
<html>
<body>
<script>
$(document).ready(function () {
//wire up button click
$('#go').click(function () {
// test for presence of geolocation
if (navigator && navigator.geolocation) {
// account.java
// Account class that contains a name instance variable
// and methods to set and get its value.
public class account {
private String name; // instance variable
// method to set the name in the object
public void setName(String name);{
this.name = name; // store the name
// AccountTest.java
// creating and manipulate an Account object.
import java.util.Scanner;
public class AccountTest {
public static void main(String[] args) {
// create a Scanner object to obtain input from the command window
Scanner input = new Scanner(System.in);
// create an Account object and assign it to myAccount
// Account.java
// Account class with a constructor that initialize the name.
public class Account {
private String name; // instance variable
// constructor initializes name with parameter name
public Account(String name) { // constructor name is class name
this.name = name;
}
private void sayHello(){
System.out.println("Hello");
System.out.println("This is a method called sayHello");
System.out.println("It contains 3 statement");
}
public class Hello {
// other parts of the class
...
private void sayHello() {
System.out.println("Hello");
System.out.println("This is a method called sayHello");
System.out.println("It contains 3 statement");
}
class Hello {
// other parts of the class
private void sayHello() {
System.out.println("Hello");
System.out.println("This is a method called sayHello");
System.out.println("It contains 3 statement");
}
public static void main(final String [] args) {