Skip to content

Instantly share code, notes, and snippets.

View srinathweb's full-sized avatar

srinath madusanka srinathweb

View GitHub Profile
(function () {
if (!Worker) //Detect IE
document.location = "http://www.whatbrowser.org/ru/browser/";
})();
<?php
/**
*
*/
class Registration_model extends CI_Model {
/**
* [__construct description]
*/
Use the .scroll() event on window, like this:
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("bottom!");
}
});
@srinathweb
srinathweb / scroling
Created April 20, 2015 03:51
scroling
$(window).on('scroll', function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 150; // set to whatever you want it to be
if(y_scroll_pos > scroll_pos_test) {
//do stuff
}
});
@srinathweb
srinathweb / mouseover
Created April 22, 2015 06:33
mouseover
$(function ()
{
$(".categoryListEl").mouseenter(function () {
$this = $(this);
$this.find("span").css("display", "block");
}).mouseleave(function ()
{
$this = $(this);
$this.find("span").hide();
<?php
// requires Facebook PHP SDK 4.0.x or later
// user must be logged-in prior to API call
// publish story, requires 'places' attribute
// use a page_id with no address to tag hidden location
// $tags is a comma-separated string of IDs
$story = (new FacebookRequest( $session, 'POST', '/me/feed', array(
<?php
try {
// Be sure to ask for the publish_actions permission first
// If you provided a 'default_access_token', third parameter '{access-token}' is optional.
$response = $fb->post( '/me/feed', [
'name' => 'Facebook API: Using the Facebook PHP SDK v4.1.x',
'link' => 'https://www.webniraj.com/2015/02/19/facebook-api-using-the-facebook-php-sdk-v4-1-x/',
'caption' => 'As version v4.1 of the Facebook PHP SDK nears release (at time of writing), I though this would be a good time to explain how the new version works. Migrating your application from v4.0.x to v4.1.x will break your application.',
'message' => 'Check out my new blog post!',
<?php
// Set the location of the Facebook PHP SDK - this should point to directory containing autoload.php
define( 'FACEBOOK_SDK_V4_SRC_DIR', './Facebook/' );
// include required files from Facebook SDK
require_once( 'Facebook/autoload.php' );
// start the session
session_start();
<?php
// Set the location of the Facebook PHP SDK - this should point to directory containing autoload.php
define( 'FACEBOOK_SDK_V4_SRC_DIR', './Facebook/' );
// include required files from Facebook SDK
require_once( 'Facebook/autoload.php' );
// start the session
session_start();
@srinathweb
srinathweb / gist:33c83205b2d6458a3aad
Created May 11, 2015 06:10
front end login wordpress
<?php /* Template Name: Login Page AA */ ?>
<?php get_header(); ?>
<!-- section -->
<section class="aa_loginForm">
<?php global $user_login;
if(isset($_GET['login']) && $_GET['login'] == 'failed')
{