Skip to content

Instantly share code, notes, and snippets.

View prosenjit-manna's full-sized avatar
🎯
Focusing

Prosenjit Manna prosenjit-manna

🎯
Focusing
  • Itobuz Technologies
View GitHub Profile
@prosenjit-manna
prosenjit-manna / functions.options.php
Created December 1, 2015 11:51 — forked from Firestorm-Graphics/functions.options.php (smof)
Dynamic sidebars for use with ( custom metaboxes & fields for wordpress, https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress) along with smof options panel or options far,work by devin - Allows you to select how many automatically generated sidebars you want & select the sidebar of your choice per page from a metabox (cmb meta…
/* Author: Dan Beaven
* Company: Firestorm Graphics
* Web: http://firestorm-graphics.com
*/
* Released under the GPL license
* http://www.opensource.org/licenses/gpl-license.php
*
* This is an add-on for WordPress
* http://wordpress.org/
*
@prosenjit-manna
prosenjit-manna / angularjs-providers-explained.md
Created November 27, 2015 10:37 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@prosenjit-manna
prosenjit-manna / .jshintrc.js
Created November 27, 2015 08:11 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@prosenjit-manna
prosenjit-manna / main.js
Last active November 20, 2015 05:02
Main JS coding style
'use strict';
// jQuery No Conflict
$.noConflict();
(function( $ ) {
//
var app = {
@prosenjit-manna
prosenjit-manna / index.html
Last active October 30, 2015 05:08 — forked from anonymous/index.html
Custom SelectBox
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background:#aaa;
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background:#aaa;
}
@prosenjit-manna
prosenjit-manna / lazyload.js
Created October 28, 2015 04:54
lazyload with jquery
$(window).on('DOMContentLoaded load resize scroll', function () {;
var images = $("#main-wrapper img[data-src]");
// load images that have entered the viewport
$(images).each(function (index) {
if (isElementInViewport(this)) {
$(this).attr("src",$(this).attr("data-src"));
$(this).removeAttr("data-src");
}
})
// if all the images are loaded, stop calling the handler
/*!
* classie v1.0.1
* class helper functions
* from bonzo https://github.com/ded/bonzo
* MIT license
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
@prosenjit-manna
prosenjit-manna / heplers.js
Last active September 3, 2015 04:15 — forked from ofstudio/heplers.js
Couple useful heplers for ghost
var hbs = require('express-hbs'),
api = require('core/server/api'),
_ = require('lodash'),
async = require('express-hbs/lib/async'), // To redefine `registerAsyncHelper`
registerAsyncHelper;
// Redefine `registerAsyncHelper` from `express-hbs`
registerAsyncHelper = function (name, fn) {
hbs.handlebars.registerHelper(name, function (context, options) {
// Pass `[context, options]` as arg instead of `context` only
@prosenjit-manna
prosenjit-manna / examples.md
Last active September 2, 2015 08:24 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video], id:-5", limit="3"});

GET /api/posts?filter=tags:[photo,video],id:-5&limit=3