Skip to content

Instantly share code, notes, and snippets.

View yesmeck's full-sized avatar
:octocat:
<img src="x" onerror="alert(1)" />

Wei Zhu yesmeck

:octocat:
<img src="x" onerror="alert(1)" />
View GitHub Profile
@yesmeck
yesmeck / google-reader.css
Created November 2, 2011 15:01
Old styled Google Reader
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("https?://www.google.com/reader/.*") {
#top-bar {
height: 40px !important;
}
#logo {
height: 27px !important;
margin: -13px 0 0 11px !important;
<?php
namespace OOXX\Entity;
/**
* @Entity(repositoryClass="OOXX\Entity\Repository\TopicRepository") @Table(name="topic")
*/
class Topic
{
/**
@yesmeck
yesmeck / lost_found.php
Created November 25, 2011 09:05
Git lost found.
#!/usr/bin/php
<?php
if (!isset($_SERVER['argv'][1])) {
exit('参数错误');
}
$search = $_SERVER['argv'][1];
$output = shell_exec('git fsck --lost-found | grep commit');
$lines = explode("\n", $output);
@yesmeck
yesmeck / newpost.sh
Created November 30, 2011 09:57
New Jekyll style post.
#!/bin/bash
echo -n "File name:"
read file_name
echo -n "Title:"
read title
echo -n "Category:"
read category
@yesmeck
yesmeck / md.css
Created December 14, 2011 06:37
Markdown preview
button.classy,button.classy:disabled,button.classy.disabled,a.button.classy:disabled,a.button.classy.disabled,button.classy:disabled:hover,button.classy.disabled:disabled:hover,a.button.classy.disabled:hover:disabled,a.button.classy.disabled:hover,a.button.classy,button.classy:disabled:hover,button.classy.disabled:disabled:hover,a.button.classy:disabled:hover,a.button.classy.disabled:disabled:hover,a.button.classy.disabled:hover{position:relative;top:1px;margin-left:10px;height:34px;padding:0;overflow:visible;font-family:Helvetica,arial,freesans,clean,sans-serif;font-weight:bold;font-size:12px;color:#333;text-shadow:1px 1px 0 #fff;white-space:nowrap;background:white;filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='white',endColorstr='#e1e1e1');background:-webkit-gradient(linear,left top,left bottom,from(white),to(#e1e1e1));background:-moz-linear-gradient(top,white,#e1e1e1);background:-o-linear-gradient(top,white,#e1e1e1);border:none;border-bottom:1px solid #ebebeb;border-radius:
@yesmeck
yesmeck / pre-commit.sh
Created December 15, 2011 07:50
Git pre-commit hook
#!/bin/sh
#
# A git hook script to find and fix trailing whitespace
# in your commits. Bypass it with the --no-verify option
# to git-commit
#
# Find files with trailing whitespace
for file in `git diff --check --cached | grep '^[^+-]' | grep -o '^.*[0-9]\+:'` ; do
@yesmeck
yesmeck / no_image_in_douban_group.user.js
Created December 26, 2011 09:24
No image in douban group
// ==UserScript==
// @name No Image In Douban Group
// @namespace douban.com
// @description No image in douban group
// @include http://www.douban.com/group/topic/*
// ==/UserScript==
var oContent = document.getElementById('content');
var aImgs = oContent.getElementsByTagName('img');
var iImgCount = aImgs.length;
@yesmeck
yesmeck / my_douban.user.js
Created January 10, 2012 05:28
自用豆瓣脚本
// ==UserScript==
// @name My Douban
// @namespace yesmeck.com
// @description 自用豆瓣脚本
// @include http://www.douban.com
// @include http://www.douban.com/*
// ==/UserScript==
var baseUrl = 'http://www.douban.com/';
@yesmeck
yesmeck / douban_rating.user.js
Created January 31, 2012 02:32
Douban Rating
// ==UserScript==
// @version 1.0
// @name Douban Rating
// @author Zhou Meng
// @description Show Douban Rating in Douban List
// @include http://*.douban.com/doulist/*
// ==/UserScript==
if ('undefined' == typeof __PAGE_SCOPE_RUN__) {
//把当前脚本注入到页面
@yesmeck
yesmeck / pastbin.sh
Created March 19, 2012 02:54
CLI Pastebin within VimEnergy
#!/usr/bin/env bash
#
# Usage:
#
# ./pastbin.sh FILE
#
file=$1
ext=$(echo $file | grep -oP '\..{2,3}' | grep -oP '[a-z]+')