Skip to content

Instantly share code, notes, and snippets.

View march1993's full-sized avatar

march1993 march1993

View GitHub Profile
@march1993
march1993 / main.c
Created February 26, 2018 20:39
Prevent Windows taskbar still being visible when applications are in fullscreen.
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
HWND hwnd = FindWindow("Shell_TrayWnd", NULL);
if (hwnd == NULL) {
fprintf(stderr, "Unable to find the taskbar.\n");
@march1993
march1993 / get_dominant_color.php
Last active March 4, 2018 00:43
PHP get dominant color
<?php
function get_featured_color() {
/* Here is an example for wordpress, replace $filepath in your situation. */
$post_thumbnail_id = get_post_thumbnail_id();
$filepath = get_attached_file($post_thumbnail_id);
$im = imagecreatefromstring(file_get_contents($filepath));
$nx = imagesx($im);
$ny = imagesy($im);
@march1993
march1993 / remove.js
Created July 12, 2018 06:06
删除新浪微博 在每一页打开 console 执行 2018/07/12
list = [].slice.call(document.getElementsByClassName('WB_cardwrap')).map(x=>x.getAttribute('mid')).filter(x=>x);
list.forEach(mid => {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'https://www.weibo.com/aj/mblog/del?ajwvr=6', false);
var fd = new FormData();
fd.append('mid', mid);
xhr.send(fd);
})