View ExplorerHotKey.ahk
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
*#e:: | |
Run C:\Program Files (x86)\XYplorer\XYplorer.exe | |
return |
View 020_add_android_permissions.js
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
/* | |
This script uses as a cordova hook and provides ability to add android permissions to AndroidManifest.xml on the fly. It also | |
checks and computes which of provided permissions are already added and didn't rewrite AndroidManifest.xml if no permissions provided. | |
Executes only for android platform. | |
Prerequirements: | |
- node 4.2+ | |
- npm modules: lodash, xml2js | |
Distributed under the MIT license. |
View DOSKEY.cmd
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
@echo off | |
DOSKEY clear=cls | |
DOSKEY ls=dir |
View getAccurateCurrentPosition.js
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
navigator.geolocation.getAccurateCurrentPosition = function (geolocationSuccess, geolocationError, geoprogress, options) { | |
var lastCheckedPosition, | |
locationEventCount = 0, | |
watchID, | |
timerID; | |
options = options || {}; | |
var checkLocation = function (position) { | |
lastCheckedPosition = position; |
View template.html
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Meta yo --> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>My Boostrap Page</title> |
View sortObject.js
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
// for OCD people or if an API requires this, in my case it was both | |
function sortObject(o) { | |
var sorted = {}, | |
key, a = []; | |
for (key in o) { | |
if (o.hasOwnProperty(key)) { | |
a.push(key); | |
} |
View formatBytes.php
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
function formatBytes($size, $precision = 2) | |
{ | |
$base = log($size, 1024); | |
$suffixes = array('', 'k', 'M', 'G', 'T'); | |
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)]; | |
} |
View gist:7043db98da78bc29023b
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
<DirectoryMatch ^.*/wp-admin/> | |
AuthType Basic | |
AuthName "Restricted Area" | |
AuthUserFile /etc/httpd/.wppass | |
Require valid-user | |
</DirectoryMatch> |
View gist:9677281
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
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'` |
View promiseTest.js
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
function getRow(id) { | |
var dfd = Q.defer(); | |
var query = db.query('SELECT * FROM table WHERE lookUp = ?', id, function(err, result) { | |
if(err) { dfd.reject(err); } | |
else { dfd.resolve(result); } | |
}); | |
return dfd.promise; | |
} |
NewerOlder