Skip to content

Instantly share code, notes, and snippets.

$ = jQuery
TIMEOUT = 20000
lastTime = (new Date()).getTime()
setInterval ->
currentTime = (new Date()).getTime()
# If timeout was paused (ignoring small
# variations) then trigger the 'wake' event
if currentTime > (lastTime + TIMEOUT + 2000)
function elementChecker(element,selectorName,selectorValue){
// if this node is not the one we want, move up the dom tree
while (element != null && element[selectorName] != selectorValue) {
element = element.parentNode;
}
// at this point we have found our containing div or we are out of parent nodes
var insideMyDiv = (element != null && element[selectorName] == selectorValue);
return {
clicked : insideMyDiv,
Right way to fetch git repo's through bower
git: -- in front of the url is important!!!
bower install --save git://github.com/MohammadYounes/AlertifyJS
@bhavyaw
bhavyaw / centos6-atrpms-ffmpeg.sh
Created July 12, 2016 11:16 — forked from ilyaevseev/centos6-atrpms-ffmpeg.sh
Install fresh FFMpeg to CentOS 6 from the dead ATrpms repo.
#!/bin/bash
rpm --import https://raw.githubusercontent.com/example42/puppet-yum/master/files/CentOS.6/rpm-gpg/RPM-GPG-KEY.atrpms
rpm -Uvh https://www.mirrorservice.org/sites/dl.atrpms.net/el6.7-x86_64/atrpms/stable/atrpms-repo-6-7.el6.x86_64.rpm
sed -i 's,http://dl,https://www.mirrorservice.org/sites/dl,' /etc/yum.repos.d/atrpms*.repo
yum install ffmpeg
@bhavyaw
bhavyaw / parseTime.js
Created June 4, 2016 14:41
Parses Time String to JavaScript Date Object
/**
* Parsing Time in String to a Date Obj
* @param timeString - time in String
* --> Acceptable Times -
* 1,01,10,011,101,110,0111,1011,
* With AM/PM - 1p,01p,10p
*
* @returns tempDateObj {Date} - Date Object that represents time String
*/
function parseTimeString(timeString) {
1.) We can't access private members in methods that are added to the object at a later point.
2.) Writing Unit Tests for Private Functions
@bhavyaw
bhavyaw / debouncer.js
Created June 4, 2016 14:41
Javascript Debounce Utilities
// Implementation
// run key up event handler as debounced key down handlers
var
_debounceTimeout; // key debouncer required params
// Usage
debounceStart(function(){
// Function which is to be debounced
});
What do i want in a editor?
1.) Emmet for html and sass
2.) Proper Documentation extension
3.) Solarized theme ( theme support )
4.) Javascript autocompletion
5.) Angular auto completion
6.) Snippets - html, sass, angular etc etc
7.) Git Integation ( Not necessary though )
8.) Alignment
  • AWS Simple Storage Service, e.g. S3, is a “highly durable and available store” and can be used to reliably store application content such as media files, static assets and user uploads. It allows you to offload your entire storage infrastructure and offers better scalability, reliability, and speed than just storing files on the filesystem.