Skip to content

Instantly share code, notes, and snippets.

View antife-yinyue's full-sized avatar
🔞

神仙 antife-yinyue

🔞
View GitHub Profile
@antife-yinyue
antife-yinyue / 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',
@antife-yinyue
antife-yinyue / 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;
@antife-yinyue
antife-yinyue / 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
@antife-yinyue
antife-yinyue / 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"/>
<!--禁止电话号码和邮箱识别-->
@antife-yinyue
antife-yinyue / 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) %}
@antife-yinyue
antife-yinyue / highlight.scss
Created February 22, 2013 05:32
Highlight styles in GitHub
pre, code {
font-family: Consolas, 'Liberation Mono', Courier, monospace;
}
.highlight {
pre {
padding: 6px 10px;
border: 1px solid #ccc;
border-radius: 3px;
background-color: #f8f8f8;
overflow: auto;
@antife-yinyue
antife-yinyue / cmd-define-js.sublime-snippet
Created June 29, 2013 05:21
Snippets for Sublime Text
<snippet>
<content><![CDATA[define(function(require, exports, module) {
$0
})]]></content>
<tabTrigger>def</tabTrigger>
<scope>source.js</scope>
<description>define(factory)</description>
</snippet>
{
// 2 空格缩进
"indent": 2,
"smarttabs": true,
// 变量在使用前必须先声明,废弃的变量要及时清理掉
"latedef": "nofunc",
"undef": true,
"unused": true,
function doubleInteger(i) {
// i will be an integer. Double it and return it.
return i * 2
}
#!/bin/bash
cd /usr/local/lib
sudo rm -rf node node_modules
cd /usr/local/bin/
sudo rm -f node npm
cd $HOME
sudo rm -rf .npm