As of April 2016. (Next month this list might be completely different.)
Ispired by:
As of April 2016. (Next month this list might be completely different.)
Ispired by:
| (function(){ | |
| // Provides a plugin name and constructor function to analytics.js. This | |
| // function works even if the site has customized the ga global identifier. | |
| function _providePlugin(pluginName, pluginConstructor) { | |
| var ga = window[window['GoogleAnalyticsObject'] || 'ga']; | |
| if (ga) ga('provide', pluginName, pluginConstructor); | |
| } | |
| // Creates the plugin to tag outbound link | |
| function outboundConstructor(tracker, config){ |
| var _gas = _gas || []; | |
| _gas.push(['_setAccount', 'UA-YYYYYY-Y']); // REPLACE WITH YOUR GA NUMBER | |
| _gas.push(['_setDomainName', '.mydomain.com']); // REPLACE WITH YOUR DOMAIN | |
| _gas.push(['_trackPageview']); | |
| _gas.push(['_gasTrackForms']); | |
| _gas.push(['_gasTrackOutboundLinks']); | |
| // Max Scroll on 20% of the pages | |
| if(Math.random() * 100 < 20) { | |
| _gas.push(['_gasTrackMaxScroll']); |
| " ========================================================== | |
| " Vundle | |
| " ========================================================== | |
| set nocompatible | |
| filetype off | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#rc() | |
| " let Vundle manage Vundle |
| var User = makeClass(); | |
| User.prototype.init = function(first, last){ | |
| this.name = first + " " + last; | |
| }; | |
| var user = User("John", "Resig"); | |
| user.name | |
| // => "John Resig" | |
| python2 -m SimpleHTTPServer |
| /** | |
| * First domain where cookies can be set by the browser. | |
| */ | |
| function get_top_domain(){ | |
| var i,h, | |
| weird_cookie='__top_level=cookie', | |
| hostname = document.location.hostname.split('.'); | |
| for(i=hostname.length-1; i>=0; i--) { | |
| h = hostname.slice(i).join('.'); | |
| document.cookie = weird_cookie + ';domain=.' + h + ';'; |
| <script type="text/javascript"> | |
| // standard GA async code | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-XXXXX-X']); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
| <script type="text/javascript"> | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-12345678-1']); | |
| _gaq.push(['_setDomainName', 'yoursite.com']); | |
| _gaq.push(['_addIgnoredRef', 'yoursite.com']); | |
| _gaq.push(['_trackPageview']); | |
| (function() { | |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |