Skip to content

Instantly share code, notes, and snippets.

View mechiland's full-sized avatar
🧘
What's Next?

Michael Chen mechiland

🧘
What's Next?
  • Hipacloud
View GitHub Profile
@mechiland
mechiland / privacy.md
Last active November 3, 2026 08:07
Immersive Unsplash privacy policy

Immersive Unsplash privacy policy

Immersive Unsplash changes the layout of supported Unsplash pages in your browser. To do this, it reads and modifies website content and navigation elements on unsplash.com. When an account menu is present, it reads the displayed account name and username to arrange that menu. It also checks the current page URL and scroll position to apply the layout. All of this processing happens locally and only supports the extension's layout features.

The extension does not persist or transmit this information, send it to the developer or any third party, sell or share it, or use it for analytics or tracking. Its use of information adheres to the Chrome Web Store User Data Policy, including the Limited Use requirements.

The extension does not make its own network requests or execute remotely hosted code. Unsplash continues to receive information and operate according to its own privacy policy when you use its website; this extension does not control Unsplash's data practices.

For

@mechiland
mechiland / repro.sh
Created September 20, 2026 06:36
eve 0.63.0: background subagent call fails the session when a hook subscribes to subagent events (minimal repro)
#!/usr/bin/env bash
# eve 0.63.0: a background subagent call fails the parent session whenever an
# authored hook subscribes to subagent.called / subagent.completed or "*".
#
# ./repro.sh # eve 0.63.0 + wildcard hook -> session.failed
# ./repro.sh 0.63.0 no # eve 0.63.0, no hook -> ok
# ./repro.sh 0.62.0 # eve 0.62.0 + wildcard hook -> ok
#
# Needs Node 24 and npm. No model credentials: EVE_MOCK_AUTHORED_MODELS=1.
set -euo pipefail
@mechiland
mechiland / delete_weibo.js
Created February 22, 2018 02:20
Delete Weibo
// ==UserScript==
// @name Delete Weibo
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://weibo.cn/<Your WeiboID>/profile
// @grant none
// ==/UserScript==
@mechiland
mechiland / Vagrantfile
Created August 3, 2016 09:44
Rails Devbox Setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.provision :shell, path: 'bootstrap.sh', keep_color: true
config.vm.network "private_network", type: "dhcp"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.hostname = 'rails-dev-box'
prefix = %w(31 32 33 34 35 36 37 38 39 51 52 53 55 56 57 58 59 70 71 72 73 75 77 80 81 82 83 85 86 87 88 89)
(1..100).each do |n|
puts "1#{prefix.sample}#{rand(10**8)}"
end
@mechiland
mechiland / JinshujuHandler.ashx
Created March 27, 2014 05:36
Jinshuju API Push for C#
<%@ WebHandler Language="C#" Class="JinshujuHandler" %>
using System;
using System.Web;
using System.Text;
using System.IO;
using Newtonsoft.Json.Linq;//引用第三方控件Newtonsoft.Json.dll
/*
*Company:QingDao Transinfo
*Author: Andy.Sun
@mechiland
mechiland / create_milestone.rb
Created December 2, 2013 08:55
create github milestones
require 'octokit'
require 'date'
milestones = [
"70: JUL29"
]
start = 92
range = (Date.parse('2014-01-01')...Date.parse('2014-3-31'))
name = "#{start}: "
@mechiland
mechiland / jinshuju.rb
Created June 27, 2013 07:20
Sinatra listening Jinshuju
require 'sinatra'
require "sinatra/streaming"
set connections: [], loggin: true, bind: '0.0.0.0'
get '/stream', provides: 'text/event-stream' do
stream :keep_open do |out|
settings.connections << out
out.callback { settings.connections.delete(out) }
end
@mechiland
mechiland / gist:5269281
Last active December 15, 2015 13:39
Mobile Web Notes
http://html5boilerplate.com/mobile/
http://zeptojs.com/
中文:
http://www.adobe.com/cn/devnet/html5/articles/flame-on-a-beginners-guide-to-emberjs.html
http://www.w3school.com.cn/html5/html_5_webstorage.asp
中文: http://emberjs.cn
http://emberjs.com/
@mechiland
mechiland / gist:5055089
Created February 28, 2013 08:09
nginx allow crawler to visit website
map $http_user_agent $is_bot {
default 0;
~*(crawl|Googlebot|Slurp|spider|bingbot|yodaobot|youdaobot)$ 1;
}
set $should_redirect 1;
if ($is_bot) {
set $should_redirect 0;
}