Skip to content

Instantly share code, notes, and snippets.

View jinkrish's full-sized avatar

Jino R Krishnan jinkrish

View GitHub Profile
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
<?php
if($_SERVER['REMOTE_ADDR']=='192.168.6.4')
{
try{
$refFunc = new ReflectionFunction('RedisSrchKey');
echo $refFunc->getFileName()."@#".$refFunc->getStartLine();
}catch(Exception $e){
echo "Function Does not EXIST";
}
<?php
class Author {
private $firstName;
private $lastName;
public function __construct($firstName, $lastName) {
$this->firstName = $firstName;
$this->lastName = $lastName;
}
<?php
class Author {
private $firstName;
private $lastName;
public function __construct($firstName, $lastName) {
$this->firstName = $firstName;
$this->lastName = $lastName;
}
<?php
class Question {
private $author;
private $question;
public function __construct($question) {
$this->question = $question;
}
public function setAuthor(Author $author) {
<?php
interface questionInterface{
public function setAuthor(Author $author);
}
class Question implements questionInterface {
private $author;
private $question;
public function __construct($question) {
$this->question = $question;
<?php
interface sessionStorage{
public function get($key);
public function set($key,$value);
}
class fileSessionStorage implements sessionStorage {
public function get($key){
...
}
public function set($key,$value){
@jinkrish
jinkrish / index.html
Last active January 21, 2017 22:04
jQuery plugin
<html>
<head>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
</head>
<body>
<div id="mydiv" ></div>
<script src="jquery.myplugin.js" ></script>
<script>
$("#mydiv").myplugin({
debug: true,
(function($){
$.fn.plugin = function(options){ }
})(jQuery);
(function($){
$.fn.plugin = function(options){ }
})(jQuery);
/**
Usage: $("#selector").plugin(options);
**/