Skip to content

Instantly share code, notes, and snippets.

View manoj-singh-developer's full-sized avatar
🎯
Focusing

Manoj Singh manoj-singh-developer

🎯
Focusing
View GitHub Profile
Question: How to redirect http to https?
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
Question: How to redirect http:// to https://www?
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
PHP script for printing first 20 Fibonacci numbers
<?php
$count = 0 ;
$f1 = 0;
$f2 = 1;
echo $f1." , ";
echo $f2." , ";
while ($count < 20 )
{
$f3 = $f2 + $f1 ;
<html>
<head>
<title>LinkedIn JavaScript API Hello World</title>
<!-- 1. Include the LinkedIn JavaScript API and define a onLoad callback function -->
<script type="text/javascript" src="https://platform.linkedin.com/in.js">
api_key: xxx
onLoad: onLinkedInLoad
authorize: true
</script>
<html>
<head> ... </head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div id="fb-root"></div>
<fb:login-button show-faces="false" perms="user_hometown,user_about_me,email,user_address" autologoutlink="true" width="200" max-rows="1"></fb:login-button>
<!-- put this before the end body tag -->
http://mycodde.blogspot.in/2014/12/login-using-google-javascript-api.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login with Google Account using JavaScript by CodexWorld</title>
<meta name="google-signin-client_id" content="872660488082-i98nbkm541c0u4nm1kqrma13198oqi7o.apps.googleusercontent.com">
<script src="jquery.min.js"></script>
<script src="https://apis.google.com/js/client:platform.js?onload=renderButton" async defer></script>
<script>
function onSuccess(googleUser) {
<html>
<head> ... </head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div id="fb-root"></div>
<fb:login-button show-faces="false" perms="user_hometown,user_about_me,email,user_address" autologoutlink="true" width="200" max-rows="1"></fb:login-button>
<!-- put this before the end body tag -->
<script>
$(document).on("change", "#avatar", function () {
var file_data = $("#avatar").prop("files")[0]; // Getting the properties of file from file field
var form_data = new FormData();
alert(form_data);// Creating object of FormData class
form_data.append("actuall_file_name", file_data) // Appending parameter named file with properties of file_field to form_data
form_data.append("user_id", 123) // Adding extra parameters to form_data
$.ajax({
url: "qualificdocs",
dataType: 'script',
<input type="color" data-bind="value: color" />
Selected: <span data-bind="text: color"></span>
ko.applyBindings({
color: ko.observable()
})
final keyword:
The final keyword in java is used to restrict the user. The java final keyword can be used in many context. Final can be:
variable
method
class
The final keyword can be applied with the variables, a final variable that have no value it is called blank final variable or uninitialized final variable. It can be initialized in the constructor only. The blank final variable can be static also which will be initialized in the static block only. We will have detailed learning of these. Let's first learn the basics of final keyword.
*If you make any variable as final, you cannot change the value of final variable(It will be constant).
*If you make any method as final, you cannot override it,final method is inherited but you cannot override it.
*If you make any class as final, you cannot extend it.
Differences between abstract class and interface in PHP
Following are some main difference between abstract classes and interface in php
In abstract classes this is not necessary that every method should be abstract. But in interface every method is abstract.
Multiple and multilevel both type of inheritance is possible in interface. But single and multilevel inheritance is possible in abstract classes.
Method of php interface must be public only. Method in abstract class in php could be public or protected both.
In abstract class you can define as well as declare methods. But in interface you can only defined your methods.
==========================================================================================================================
1) Abstract class can have abstract and non-abstractmethods.Interface can have only abstract methods.