Skip to content

Instantly share code, notes, and snippets.

View yyclaw's full-sized avatar
🔞

YYClaw yyclaw

🔞
  • Ant International
  • Hangzhou, China
View GitHub Profile
@yyclaw
yyclaw / pagination.html
Last active June 22, 2022 20:59
Pagination for Jekyll site
{% if paginator.total_pages > 1 %}
<!-- Pagination -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% endif %}
{% for page in (1..paginator.total_pages) %}
@yyclaw
yyclaw / h5g
Created July 19, 2012 09:03 — forked from wintercn/h5g
HTML5 Canvas Game Template
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<!--允许全屏-->
<meta content="yes" name="apple-mobile-web-app-capable"/>
<meta content="yes" name="apple-touch-fullscreen"/>
<!--禁止电话号码和邮箱识别-->
@yyclaw
yyclaw / shjs.js
Created May 22, 2012 08:16
The main script and language definition
/*!
* Copyright (C) 2007, 2008 gnombat@users.sourceforge.net
* License: http://shjs.sourceforge.net/doc/gplv3.html
*/
function sh_highlightDocument(){var a=document.getElementsByTagName("pre"),b,c,d;for(var e=-1,f=a.length;++e<f;){b=a[e],d=sh_getClasses(b),c="";for(var g=-1,h=d.length;++g<h;){c=d[g].replace("sh_","");if(!!c&&!!sh_languages[c]){sh_highlightElement(b,sh_languages[c]);break}}}}function sh_highlightElement(a,b){sh_addClass(a,"sh_sourcecode");var c=[],d=sh_extractTags(a,c),e=sh_highlightString(d,b),f=sh_mergeTags(c,e),g=sh_insertTags(f,d);while(a.hasChildNodes())a.removeChild(a.firstChild);a.appendChild(g)}function sh_isEmailAddress(a){return/^mailto:/.test(a)?!1:a.indexOf("@")!==-1}function sh_setHref(a,b,c){var d=c.substring(a[b-2].pos,a[b-1].pos);d.length>=2&&d.charAt(0)==="<"&&d.charAt(d.length-1)===">"&&(d=d.substr(1,d.length-2)),sh_isEmailAddress(d)&&(d="mailto:"+d),a[b-2].node.href=d}function sh_konquerorExec(a){var b=[""];return b.index=a.length,b.input=a,b}function sh_highlightString(a
@yyclaw
yyclaw / sh-highlight.scss
Created May 22, 2012 08:09
The theme for shjs
/**
* Highlight
* Railscasts from Textmate
* More: http://shjs.sourceforge.net/
*/
pre[class^='sh_'], .sh_sourcecode {
overflow-x: auto;
margin-top: 1em;
padding: 8px 12px;
border: 1px solid #e8e8e8;
@yyclaw
yyclaw / textStorage.js
Created September 19, 2011 04:39 — forked from sofish/textStorage.js
Cross-browser TextStorage Solution
/**
* @ NAME: Cross-browser TextStorage
* @ DESC: text storage solution for your pages
* @ COPY: sofish, http://sofish.de
*/
typeof window.localStorage == 'undefined' && ~function () {
var localStorage = window.localStorage = {},
prefix = 'data-userdata',