Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
386 changes: 238 additions & 148 deletions 2016/04/06/Linux/Kali-Linux/index.html

Large diffs are not rendered by default.

388 changes: 239 additions & 149 deletions 2016/04/06/Linux/Ubuntu14-04-Update-Kernel:Missing-Modules/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/04/30/Mobile Security/Protection-Measures-Of-APK/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/05/05/Linux/正则表达式必知必会/index.html

Large diffs are not rendered by default.

379 changes: 234 additions & 145 deletions 2016/05/17/Programming/Trie树/index.html

Large diffs are not rendered by default.

379 changes: 234 additions & 145 deletions 2016/05/18/Programming/搜索之枚举/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/05/19/Programming/最长回文子串/index.html

Large diffs are not rendered by default.

379 changes: 234 additions & 145 deletions 2016/06/13/Debug/软件调试书单/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/06/15/Debug/软件调试的原则/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/06/16/Debug/主要的调试器操作/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/06/19/Mobile Security/APKTOOL学习指南/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/06/20/Debug/IDA-PRO-插件/index.html

Large diffs are not rendered by default.

379 changes: 234 additions & 145 deletions 2016/06/29/Programming/搜索之BFS/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/06/29/Programming/硬币问题:贪心算法/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/07/16/Linux/Ubuntu-14-04-设置方法/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/07/30/Debug/调试器gdb的基本使用方法(1)/index.html

Large diffs are not rendered by default.

386 changes: 238 additions & 148 deletions 2016/07/31/Debug/调试器gdb的基本使用方法(2)/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/10/07/PWN/Linux栈溢出利用之DynELF实例/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/10/07/PWN/Linux栈溢出利用之return-to-dl-resolve/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/10/07/PWN/Linux栈溢出漏洞利用小结/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/11/03/PWN/ret2-dl-resolve-payload-构造原理(一)/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2016/11/03/PWN/ret2-dl-resolve-payload-构造原理(二)/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2017/02/17/PWN/Linux堆溢出之fastbin实例/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2017/02/24/PWN/Linux堆漏洞之Double-free/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2017/03/01/PWN/Linux堆漏洞之off-by-one/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2017/03/04/PWN/Linux堆漏洞之Use-after-free实例/index.html

Large diffs are not rendered by default.

380 changes: 235 additions & 145 deletions 2017/03/11/Mobile Security/ARM32-汇编语言/index.html

Large diffs are not rendered by default.

384 changes: 239 additions & 145 deletions 2017/03/17/Mobile Security/ARM64-汇编语言/index.html

Large diffs are not rendered by default.

1,026 changes: 1,026 additions & 0 deletions 2018/03/09/Linux/Linux-Shell-命令/index.html

Large diffs are not rendered by default.

378 changes: 222 additions & 156 deletions archives/2016/04/index.html

Large diffs are not rendered by default.

406 changes: 234 additions & 172 deletions archives/2016/05/index.html

Large diffs are not rendered by default.

434 changes: 246 additions & 188 deletions archives/2016/06/index.html

Large diffs are not rendered by default.

378 changes: 222 additions & 156 deletions archives/2016/07/index.html

Large diffs are not rendered by default.

378 changes: 222 additions & 156 deletions archives/2016/10/index.html

Large diffs are not rendered by default.

364 changes: 216 additions & 148 deletions archives/2016/11/index.html

Large diffs are not rendered by default.

478 changes: 265 additions & 213 deletions archives/2016/index.html

Large diffs are not rendered by default.

478 changes: 265 additions & 213 deletions archives/2016/page/2/index.html

Large diffs are not rendered by default.

380 changes: 223 additions & 157 deletions archives/2016/page/3/index.html

Large diffs are not rendered by default.

364 changes: 216 additions & 148 deletions archives/2017/02/index.html

Large diffs are not rendered by default.

392 changes: 228 additions & 164 deletions archives/2017/03/index.html

Large diffs are not rendered by default.

420 changes: 240 additions & 180 deletions archives/2017/index.html

Large diffs are not rendered by default.

392 changes: 242 additions & 150 deletions tags/RegExp/index.html → archives/2018/03/index.html

Large diffs are not rendered by default.

392 changes: 242 additions & 150 deletions tags/字符串处理/index.html → archives/2018/index.html

Large diffs are not rendered by default.

511 changes: 284 additions & 227 deletions archives/index.html

Large diffs are not rendered by default.

494 changes: 273 additions & 221 deletions archives/page/2/index.html

Large diffs are not rendered by default.

499 changes: 294 additions & 205 deletions archives/page/3/index.html

Large diffs are not rendered by default.

486 changes: 283 additions & 203 deletions categories/Linux/index.html

Large diffs are not rendered by default.

404 changes: 233 additions & 171 deletions categories/Mobile-Security/index.html

Large diffs are not rendered by default.

404 changes: 233 additions & 171 deletions categories/Programming/index.html

Large diffs are not rendered by default.

474 changes: 263 additions & 211 deletions categories/Security/index.html

Large diffs are not rendered by default.

364 changes: 220 additions & 144 deletions categories/index.html

Large diffs are not rendered by default.

1,080 changes: 576 additions & 504 deletions css/main.css

Large diffs are not rendered by default.

1,260 changes: 883 additions & 377 deletions index.html

Large diffs are not rendered by default.

186 changes: 96 additions & 90 deletions js/src/affix.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,157 +6,163 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */

/**
* Customized by Ivan.Nginx
*
* - Refactored with eslint-config-theme-next style.
*/

+function ($) {
(function($) {
'use strict';

// AFFIX CLASS DEFINITION
// ======================

var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)
var Affix = function(element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options);

this.$target = $(this.options.target)
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this));

this.$element = $(element)
this.affixed = null
this.unpin = null
this.pinnedOffset = null
this.$element = $(element);
this.affixed = null;
this.unpin = null;
this.pinnedOffset = null;

this.checkPosition()
}
this.checkPosition();
};

Affix.VERSION = '3.3.5'
Affix.VERSION = '3.3.5';

Affix.RESET = 'affix affix-top affix-bottom'
Affix.RESET = 'affix affix-top affix-bottom';

Affix.DEFAULTS = {
offset: 0,
target: window
}
};

Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
var targetHeight = this.$target.height()
Affix.prototype.getState = function(scrollHeight, height, offsetTop, offsetBottom) {
var scrollTop = this.$target.scrollTop();
var position = this.$element.offset();
var targetHeight = this.$target.height();

if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
if (offsetTop != null && this.affixed === 'top') return scrollTop < offsetTop ? 'top' : false;

if (this.affixed == 'bottom') {
if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
if (this.affixed === 'bottom') {
if (offsetTop != null) return scrollTop + this.unpin <= position.top ? false : 'bottom';
return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom';
}

var initializing = this.affixed == null
var colliderTop = initializing ? scrollTop : position.top
var colliderHeight = initializing ? targetHeight : height
var initializing = this.affixed == null;
var colliderTop = initializing ? scrollTop : position.top;
var colliderHeight = initializing ? targetHeight : height;

if (offsetTop != null && scrollTop <= offsetTop) return 'top'
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
if (offsetTop != null && scrollTop <= offsetTop) return 'top';
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom';

return false
}
return false;
};

Affix.prototype.getPinnedOffset = function () {
if (this.pinnedOffset) return this.pinnedOffset
this.$element.removeClass(Affix.RESET).addClass('affix')
var scrollTop = this.$target.scrollTop()
var position = this.$element.offset()
return (this.pinnedOffset = position.top - scrollTop)
}
Affix.prototype.getPinnedOffset = function() {
if (this.pinnedOffset) return this.pinnedOffset;
this.$element.removeClass(Affix.RESET).addClass('affix');
var scrollTop = this.$target.scrollTop();
var position = this.$element.offset();
return (this.pinnedOffset = position.top - scrollTop);
};

Affix.prototype.checkPositionWithEventLoop = function () {
setTimeout($.proxy(this.checkPosition, this), 1)
}
Affix.prototype.checkPositionWithEventLoop = function() {
setTimeout($.proxy(this.checkPosition, this), 1);
};

Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
Affix.prototype.checkPosition = function() {
if (!this.$element.is(':visible')) return;

var height = this.$element.height()
var offset = this.options.offset
var offsetTop = offset.top
var offsetBottom = offset.bottom
var scrollHeight = Math.max($(document).height(), $(document.body).height())
var height = this.$element.height();
var offset = this.options.offset;
var offsetTop = offset.top;
var offsetBottom = offset.bottom;
var scrollHeight = Math.max($(document).height(), $(document.body).height());

if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
/* eslint-disable */
if (typeof offset !== 'object') offsetBottom = offsetTop = offset;
if (typeof offsetTop === 'function') offsetTop = offset.top(this.$element);
if (typeof offsetBottom === 'function') offsetBottom = offset.bottom(this.$element);
/* eslint-enable */

var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom);

if (this.affixed != affix) {
if (this.unpin != null) this.$element.css('top', '')
if (this.affixed !== affix) {
if (this.unpin != null) this.$element.css('top', '');

var affixType = 'affix' + (affix ? '-' + affix : '')
var e = $.Event(affixType + '.bs.affix')
var affixType = 'affix' + (affix ? '-' + affix : '');
var e = new $.Event(affixType + '.bs.affix');

this.$element.trigger(e)
this.$element.trigger(e);

if (e.isDefaultPrevented()) return
if (e.isDefaultPrevented()) return;

this.affixed = affix
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
this.affixed = affix;
this.unpin = affix === 'bottom' ? this.getPinnedOffset() : null;

this.$element
.removeClass(Affix.RESET)
.addClass(affixType)
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
.trigger(affixType.replace('affix', 'affixed') + '.bs.affix');
}

if (affix == 'bottom') {
if (affix === 'bottom') {
this.$element.offset({
top: scrollHeight - height - offsetBottom
})
});
}
}

};

// AFFIX PLUGIN DEFINITION
// =======================

function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.affix')
var options = typeof option == 'object' && option

if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
return this.each(function() {
var $this = $(this);
var data = $this.data('bs.affix');
var options = typeof option === 'object' && option;

if (!data) $this.data('bs.affix', data = new Affix(this, options));
if (typeof option === 'string') data[option]();
});
}

var old = $.fn.affix

$.fn.affix = Plugin
$.fn.affix.Constructor = Affix
var old = $.fn.affix;

$.fn.affix = Plugin;
$.fn.affix.Constructor = Affix;

// AFFIX NO CONFLICT
// =================

$.fn.affix.noConflict = function () {
$.fn.affix = old
return this
}

$.fn.affix.noConflict = function() {
$.fn.affix = old;
return this;
};

// AFFIX DATA-API
// ==============

$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
var data = $spy.data()
$(window).on('load', function() {
$('[data-spy="affix"]').each(function() {
var $spy = $(this);
var data = $spy.data();

data.offset = data.offset || {}
data.offset = data.offset || {};

if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
if (data.offsetTop != null) data.offset.top = data.offsetTop
/* eslint-disable */
if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom;
if (data.offsetTop != null) data.offset.top = data.offsetTop;
/* eslint-enable */

Plugin.call($spy, data)
})
})
Plugin.call($spy, data);
});
});

}(jQuery);
}(jQuery));
81 changes: 40 additions & 41 deletions js/src/algolia-search.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/* global instantsearch: true */
/*jshint camelcase: false */
/* global instantsearch, CONFIG */

$(document).ready(function () {
$(document).ready(function() {
var algoliaSettings = CONFIG.algolia;
var isAlgoliaSettingsValid = algoliaSettings.applicationID &&
algoliaSettings.apiKey &&
algoliaSettings.indexName;
var isAlgoliaSettingsValid = algoliaSettings.applicationID
&& algoliaSettings.apiKey
&& algoliaSettings.indexName;

if (!isAlgoliaSettingsValid) {
window.console.error('Algolia Settings are invalid.');
return;
}

var search = instantsearch({
appId: algoliaSettings.applicationID,
apiKey: algoliaSettings.apiKey,
indexName: algoliaSettings.indexName,
searchFunction: function (helper) {
appId : algoliaSettings.applicationID,
apiKey : algoliaSettings.apiKey,
indexName : algoliaSettings.indexName,
searchFunction: function(helper) {
var searchInput = $('#algolia-search-input').find('input');

if (searchInput.val()) {
Expand All @@ -28,27 +27,27 @@ $(document).ready(function () {
// Registering Widgets
[
instantsearch.widgets.searchBox({
container: '#algolia-search-input',
container : '#algolia-search-input',
placeholder: algoliaSettings.labels.input_placeholder
}),

instantsearch.widgets.hits({
container: '#algolia-hits',
container : '#algolia-hits',
hitsPerPage: algoliaSettings.hits.per_page || 10,
templates: {
item: function (data) {
var link = data.permalink ? data.permalink : (CONFIG.root + data.path);
templates : {
item: function(data) {
var link = data.permalink ? data.permalink : CONFIG.root + data.path;
return (
'<a href="' + link + '" class="algolia-hit-item-link">' +
data._highlightResult.title.value +
'</a>'
'<a href="' + link + '" class="algolia-hit-item-link">'
+ data._highlightResult.title.value
+ '</a>'
);
},
empty: function (data) {
empty: function(data) {
return (
'<div id="algolia-hits-empty">' +
algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query) +
'</div>'
'<div id="algolia-hits-empty">'
+ algoliaSettings.labels.hits_empty.replace(/\$\{query}/, data.query)
+ '</div>'
);
}
},
Expand All @@ -60,36 +59,36 @@ $(document).ready(function () {
instantsearch.widgets.stats({
container: '#algolia-stats',
templates: {
body: function (data) {
body: function(data) {
var stats = algoliaSettings.labels.hits_stats
.replace(/\$\{hits}/, data.nbHits)
.replace(/\$\{time}/, data.processingTimeMS);
.replace(/\$\{hits}/, data.nbHits)
.replace(/\$\{time}/, data.processingTimeMS);
return (
stats +
'<span class="algolia-powered">' +
' <img src="' + CONFIG.root + 'images/algolia_logo.svg" alt="Algolia" />' +
'</span>' +
'<hr />'
stats
+ '<span class="algolia-powered">'
+ ' <img src="' + CONFIG.root + 'images/algolia_logo.svg" alt="Algolia" />'
+ '</span>'
+ '<hr />'
);
}
}
}),

instantsearch.widgets.pagination({
container: '#algolia-pagination',
scrollTo: false,
container : '#algolia-pagination',
scrollTo : false,
showFirstLast: false,
labels: {
first: '<i class="fa fa-angle-double-left"></i>',
last: '<i class="fa fa-angle-double-right"></i>',
labels : {
first : '<i class="fa fa-angle-double-left"></i>',
last : '<i class="fa fa-angle-double-right"></i>',
previous: '<i class="fa fa-angle-left"></i>',
next: '<i class="fa fa-angle-right"></i>'
next : '<i class="fa fa-angle-right"></i>'
},
cssClasses: {
root: 'pagination',
item: 'pagination-item',
link: 'page-number',
active: 'current',
root : 'pagination',
item : 'pagination-item',
link : 'page-number',
active : 'current',
disabled: 'disabled-item'
}
})
Expand All @@ -106,7 +105,7 @@ $(document).ready(function () {
$('#algolia-search-input').find('input').focus();
});

$('.popup-btn-close').click(function(){
$('.popup-btn-close').click(function() {
$('.popup').hide();
$('.algolia-pop-overlay').remove();
$('body').css('overflow', '');
Expand Down
Loading