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
// category id in body and post class | |
function category_id_class($classes) { | |
global $post; | |
foreach((get_the_category($post->ID)) as $category) | |
$classes [] = 'cat-' . $category->cat_ID . '-id'; | |
return $classes; | |
} | |
add_filter('post_class', 'category_id_class'); | |
add_filter('body_class', 'category_id_class'); |
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
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType text/css "access 1 month" | |
ExpiresByType application/pdf "access 1 month" | |
ExpiresByType text/x-javascript "access 1 month" |
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
.factory('DB', function ($q, $http, DB_CONFIG) { | |
var self = this; | |
self.db = null; | |
/*self.db_open = function () { | |
self.db = window.sqlitePlugin.openDatabase({name: DB_CONFIG.name, bgType: 1}); | |
};*/ | |
self.db_open =function(){ | |
var def = $q.defer(); |
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
Linux: | |
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android | |
Windows: | |
keytool -list -v -keystore %USERPROFILE%/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android |
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
.filter('cut', function(){ | |
return function (value, wordwise, max, tail) { | |
if (!value) return ''; | |
max = parseInt(max, 10); | |
if (!max) return value; | |
if (value.length <= max) return value; | |
value = value.substr(0, max); | |
if (wordwise) { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Windows - inside c:\openssl\bin | |
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | ".\openssl.exe" sha1 -binary | ".\openssl.exe" base64 |
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 listDir(path){ | |
window.resolveLocalFileSystemURL(path, | |
function (fileSystem) { | |
var reader = fileSystem.createReader(); | |
reader.readEntries( | |
function (entries) { | |
console.log(entries); | |
}, | |
function (err) { | |
console.log(err); |
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
adb shell pm list packages | |
adb shell pm path com.example.app |
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
// Console.save | |
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} |
OlderNewer