This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* real3d detects support for csstransforms3d and gives | |
* result both to html classes and javascript property | |
* (just like Modernizr does) | |
* | |
* Unlike Modernizr, it's doing this non trivial test | |
* on real element inside real document's body, relaying | |
* on computated css transform property as distinctive | |
* factor for testing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Find out what is that damn element with highest z-index, | |
* or simply get the z-index 'picture' of DOM | |
* | |
* USAGE: simply paste this in console, hit enter | |
*/ | |
var all = document.getElementsByTagName('*'), | |
allLength = all.length; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Element wrapper, necessary | |
* for attaching custom user | |
* data to element. | |
* | |
* It acts like jQuery wrapper | |
* -creates an instance of wrapper | |
* with element as zero field | |
* providing access to `data` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery contenteditablechanged | |
* | |
* Fires custom event named 'contenteditablechanged' when | |
* textcontent of element marked with contenteditable='true' | |
* changes. | |
* | |
* Usage: | |
* $('[contenteditable]').on('contenteditablechanged', function(e){ | |
* console.log(e); //-- Event properits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* $(element).triggerOnce('muCustomEvent') instead | |
* of $(element).trigger('muCustomEvent') | |
* when goal is to neutralize multiple event triggering | |
*/ | |
$.fn.triggerOnce = function(eventName){ | |
if (! this.data( 'triggered-' + eventName ) ) { | |
this.trigger(eventName).data( 'triggered-' + eventName, true ); | |
} | |
return this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Useful for forcing all transform functions defined in @keyframes to execute simultaneously | |
* Many (including myself until recently) doesn't know that transform functions defined | |
* into @keyframes doesn't play simultaneously | |
* but in reversed order of declaration | |
* | |
* More info about this issue: | |
* https://css-tricks.com/debugging-css-keyframe-animations/ | |
* | |
* USAGE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RESULT="$(ps -A | grep proftpd)" | |
if $( echo $RESULT | grep --quiet 'proftpd' ) | |
then | |
echo 'Service PROFTPD is fine, no need for action...' | |
else | |
service proftpd stop | |
service proftpd start |
NewerOlder