Skip to content

Instantly share code, notes, and snippets.

View YuJianrong's full-sized avatar

Jianrong Yu YuJianrong

  • SAP Signavio
  • San Francisco, US
View GitHub Profile
阮一峰的网络日志 » 首页 » 档案
搜索
上一篇:科技爱好者周刊(第 2
分类: 周刊
科技爱好者周刊(第 241 期):中国的增长动力在内陆
作者: 阮一峰
日期: 2023年2月10日
这里记录每周值得分享的科技内容,周五发布。
@YuJianrong
YuJianrong / backdrop.blur.demo.html
Created May 11, 2020 14:08
css backdrop-filter.blur.demo
<div style="
position: fixed;
background: rgba(253, 202, 202, 0.26);
padding: 100px 180px;
z-index: 100;
transform: translate(-50%, -50%);
left: 50%;
top: 50%;
border-radius: 50px;
-webkit-mask-image: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(255,255,255,0) 100%),linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(0,0,0,1) 15%, rgba(0,0,0,1) 85%, rgba(255,255,255,0) 100%);
@YuJianrong
YuJianrong / git-watchs.js
Last active February 21, 2019 00:27
gist to load the stars and watchs from the <a> link
! function () {
window.addEventListener('mousemove', async ev => {
const path = ev.path || ev.composedPath();
const elm = path.find(ev => ev.tagName === 'A');
if (!elm || elm.visited) {
return;
}
elm.visited = true;
const parts = /.*github\.com\/(.*?)\/(.*?)\/.*/.exec(elm.href + "/");
if (!parts) {
@YuJianrong
YuJianrong / index.html
Created January 10, 2018 21:01
JS Bin resizable textares // source https://jsbin.com/wimujah
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="resizable textares">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
div {
box-sizing: border-box;
@YuJianrong
YuJianrong / permutation2.js
Created March 9, 2013 03:07
Get permutation from the index of the permutation.
var x=[1,2,3,4,5,6];
function factorial(i) {
if (!factorial.memorize[i]) {
factorial.memorize[i] = i * factorial(i-1);
}
return factorial.memorize[i];
}
factorial.memorize = {0:1};
@YuJianrong
YuJianrong / permutation.js
Created July 20, 2012 10:26
permutation string
function nextPerm (str) {
var arr = str.split("").reverse();
for (var i=1; i<arr.length; ++i) {
if ( arr[i] < arr[i-1] ) {
break;
}
};
if ( i >= arr.length ) {
return false;
};
@YuJianrong
YuJianrong / iPadMangaReaderSpecial.html
Created March 10, 2012 07:26
iPadMangaReaderSpecial
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
Copyright 2010 Yu Jianrong, All Rights Reserved
Licensed under BSD License.
-->
<head>
<meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0,maximum-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
@YuJianrong
YuJianrong / iPadMangaReader.js
Created March 10, 2012 07:16
iPadMangaReader.js
//
// Copyright 2010 Yu Jianrong, All Rights Reserved
//
// Licensed under BSD License.
// special case, remove iframe of dm5 page (not include the comic page)
if (window.location.host==="www.dm5.com" && !(/^\/m/.test(window.location.pathname)))
{
var ifs=document.getElementsByTagName("iframe");
@YuJianrong
YuJianrong / Mark watchers count of git repos
Created February 17, 2012 09:32
Add watchers count after the link of the git repository (https://github.com/user/repos/). Executed in the console of browser
var linksIterator=document.querySelectorAll("a[href^='http://github.com/'],a[href^='https://github.com']");
var links=[];
var callbackIndex = 0;
for (var i=0;i<linksIterator.length;++i) {
linksIterator[i].addEventListener("mouseover", (function(link) { return function(e) {
if ( link.watched ) return;
link.watched = true;