// Disable Context Menu
document.oncontextmenu = function () {
return false
};
// Disable dragging of HTML elements
document.ondragstart = function () {
return false
};
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
| // Post repeat directive for logging the rendering time | |
| angular.module('myApp').directive('postRepeatDirective', | |
| ['$timeout', | |
| function($timeout) { | |
| return function(scope) { | |
| if (scope.$first) | |
| window.a = new Date(); // window.a can be updated anywhere if to reset counter at some action if ng-repeat is not getting started from $first | |
| if (scope.$last) | |
| $timeout(function(){ | |
| console.log("## DOM rendering list took: " + (new Date() - window.a) + " ms"); |
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
| getReferrerTraits = function() { | |
| // Requires: jQuery, jQuery.cookie, segment.io | |
| // TODO: Update referralHost:blackList with your domain, so we only track external referrers. | |
| var analytics_args = [], | |
| analytics_traits, | |
| acquisitionSource, | |
| firstReferrer, | |
| firstCampaign, |
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
| #!/usr/bin/python | |
| ''' | |
| Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2 | |
| Correct PIN for hash and salt below is 1234. | |
| Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone | |
| Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db |
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
| .modal { | |
| width: 800px; | |
| left: 40%; | |
| } | |
| .lightbox-content { | |
| width: 100%; | |
| } | |
| .lightbox-image { |
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
| (function() { | |
| // Chart design based on the recommendations of Stephen Few. Implementation | |
| // based on the work of Clint Ivy, Jamie Love, and Jason Davies. | |
| // http://projects.instantcognition.com/protovis/bulletchart/ | |
| d3.bullet = function() { | |
| var orient = "left", // TODO top & bottom | |
| reverse = false, | |
| duration = 0, | |
| ranges = bulletRanges, |
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
| // Copyright 2012 Google Inc. All Rights Reserved. | |
| /* Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software | |
| * distributed under the License is distributed on an "AS IS" BASIS, |
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
| // NOTE: This is developed for the "old" GA, not Universal Analytics | |
| // Create the test | |
| var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal"; | |
| // Pass it along through GA | |
| var _gaq = _gaq || []; | |
| _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); | |
| // --- IMPORTANT LINE! |
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
| /* | |
| * Asynchronous loading of ads. | |
| * Below is of the top of my head rewrite to load multiple ads at the same time | |
| * in a asynchronous fashion. | |
| * | |
| * I gave it a quick test run and it seems to work as fare as I can see | |
| * | |
| * | |
| * var EpomConfig = EpomConfig || {ads : []}; | |
| * (function(){ |
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
| var page = new WebPage(), | |
| address, output, size; | |
| //capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
| capture = function(targetFile, clipRect) { | |
| var previousClipRect; | |
| var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
| if (clipRect) { | |
| if (!isType(clipRect, "object")) { | |
| throw new Error("clipRect must be an Object instance."); |