Skip to content

Instantly share code, notes, and snippets.

View msrafi's full-sized avatar

Rafi msrafi

  • Jersey City
View GitHub Profile

#AngularJS Application List Here is a list of some Angular Free Application / snippets to help you out with your projects

angular git://github.com/angular/bower-angular.git
angular-mocks git://github.com/angular/bower-angular-mocks.git
angular-resource git://github.com/angular/bower-angular-resource.git
angular-scenario git://github.com/angular/bower-angular-scenario.git
angular-cookies git://github.com/angular/bower-angular-cookies.git
angular-sanitize git://github.com/angular/bower-angular-sanitize.git

angular-bootstrap git://github.com/angular-ui/bootstrap-bower.git

function htmlToPlaintext(text) {
return text ? String(text).replace(/<[^>]+>/gm, '') : '';
}
usage :
var plain_text = htmlToPlaintext( your_html );
With angular.js :
angular.module('myApp.filters', []).
filter('htmlToPlaintext', function() {
@msrafi
msrafi / doubleClick.js
Created September 14, 2015 20:31
jquery Double Click
var DELAY = 700,
clicks = 0,
timer = null;
$(document).ready(function() {
$(document).on("click", 'td.calendarDesc', function(e){
clicks++; //count clicks
var didScroll = false;
window.onscroll = doThisStuffOnScroll;
function doThisStuffOnScroll() {
didScroll = true;
}
setInterval(function() {
if(didScroll) {
/*global jQuery */
;(function($) {
/*global document */
"use strict";
if (typeof document !== 'undefined' && ('classList' in document.createElement('a'))) {
var $ = jQuery;
@msrafi
msrafi / mobileZoom.js
Created June 29, 2015 21:17
Check page zoom
$(document).on('scroll', function(){
var zoom = document.documentElement.clientWidth / window.innerWidth;
console.log(zoom);
});
@msrafi
msrafi / README
Last active August 29, 2015 14:23 — forked from joelambert/README
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported (or any of its browser-specific implementations)
*
* @param string p - css property name
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator
*
* @Author: Axel Jack Fuchs (Cologne, Germany)
* @Date: 08-29-2010 18:43
*
@msrafi
msrafi / jquery_dynplugin
Created May 29, 2015 21:43
dynamical jquery plugin
// This is our NEWSAMPLE Component - Say Accordion - Lets put in the seperate file
var NewSample = {
init: function(elem, options){
var elem = $(elem);
// Some function for this accordion
if (options && typeof(options) == 'object') {
// extend the options here
console.log(options);
@msrafi
msrafi / funcname.js
Created May 29, 2015 03:05
Function name
<script type="text/javascript">
/* create functions that can report their own names,
by looking into the arguments used to invoke them
*/
function FunctionA(){
var fName = arguments.callee.toString().match(/function ([^\(]+)/)[1]
alert('Hi, I\'m in a function named '+fName)
}