This file contains 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
https://stackoverflow.com/questions/37063267/high-cpu-usage-with-android-emulator-qemu-system-i386-exe | |
The cause of the constant CPU usage is the sound. If you do not need sound in your emulator you can disable it by editing the AVD's config file. | |
Change/add those two lines | |
hw.audioInput=no | |
hw.audioOutput=no | |
On Linux/Mac the file is located at ~/.android/avd/<AVD_Name>.avd/config.ini | |
On Windows the file is located at C:\Users\<username>\.android\avd\<AVD_Name>.avd\config.ini |
This file contains 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 matrixExample = [ | |
[ 1, 2, 3, 4 ], | |
[ 4, 5, 6, 5 ], | |
[ 7, 8, 9, 7 ], | |
[ 7, 8, 9, 7 ] | |
]; | |
function sumUpDiagonals(matrix) { | |
var sumMain = 0; | |
var sumSec = 0; |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<system.webServer> | |
<security> | |
<authorization> | |
<remove users="*" roles="" verbs="" /> | |
<add accessType="Allow" users="?" verbs="OPTIONS" /> | |
</authorization> | |
</security> | |
<httpProtocol> |
This file contains 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
let xDown = null; | |
let yDown = null; | |
function handleTouchStart(evt) { | |
xDown = evt.touches[0].clientX; | |
yDown = evt.touches[0].clientY; | |
} | |
function handleTouchMove(evt) { | |
if ( ! xDown || ! yDown ) { |
This file contains 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
//Fluid font | |
//fluid-type(320px, 2560px, 16px, 20px) for 2.5k resolution | |
fluid-type(min-vw, max-vw, min-font-size, max-font-size) | |
u1 = unit(min-vw) | |
u2 = unit(max-vw) | |
u3 = unit(min-font-size) | |
u4 = unit(max-font-size) | |
if u1 == u2 and u1 == u3 and u1 == u4 | |
& | |
font-size: min-font-size |
This file contains 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
/** | |
* Add dataset support to elements | |
* No globals, no overriding prototype with non-standard methods, | |
* handles CamelCase properly, attempts to use standard | |
* Object.defineProperty() (and Function bind()) methods, | |
* falls back to native implementation when existing | |
* Inspired by http://code.eligrey.com/html5/dataset/ | |
* (via https://github.com/adalgiso/html5-dataset/blob/master/html5-dataset.js ) | |
* Depends on Function.bind and Object.defineProperty/Object.getOwnPropertyDescriptor (polyfills below) | |
* All code below is Licensed under the X11/MIT License |
This file contains 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
//*****************************// | |
//***Scroll disable***// | |
//*****************************// | |
// left: 37, up: 38, right: 39, down: 40, | |
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36 | |
let keys = {37: 1, 38: 1, 39: 1, 40: 1}; | |
function preventDefault(e) { | |
e = e || window.event; |
This file contains 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
// Fonts mixin | |
font-url(file) | |
return '../fonts/' + file | |
webfont(family, file, hack-chrome-windows = false, weight = 'normal') | |
@font-face | |
font-family family | |
src url(font-url(file + '.eot')) | |
src url(font-url(file + '.eot?#iefix')) format('embedded-opentype'), | |
url(font-url(file + '.woff')) format('woff'), |
This file contains 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
$.fn.imagesLoaded = function () { | |
// get all the images | |
let $imgs = this.find('img[src!=""]'); | |
// if there's no images return resolved promise | |
if (!$imgs.length) {return $.Deferred().resolve().promise();} | |
// for each image, add a deferred object to the array | |
let dfdarr = []; | |
$imgs.each(function(){ |