Skip to content

Instantly share code, notes, and snippets.

View einverne's full-sized avatar
🥝
Focusing

Ein Verne einverne

🥝
Focusing
View GitHub Profile
@kejun
kejun / GM Script: 自动用xiami播放专辑
Created January 12, 2011 10:29
Douban音乐推荐直接用xiami播放
// ==UserScript==
// @name douban_xiami
// @namespace org.kejun
// @include http://music.douban.com/*
// ==/UserScript==
//使用说明:
// 1. 安装本脚本到Greasemonkey
// 2. 到http://music.douban.com/recommended
// 3. 点击专辑封面会自动用虾米播放(如果窗口没弹出,检查是否被浏览器拦截)
@quietlynn
quietlynn / gplus.keyboard.user.js
Created August 14, 2012 14:54
Google+ Keyboard Shortcuts
/*
Google+ Keyboard Shortcuts
Copyright (C) 2012 Jingqin Lynn
Includes jQuery
Copyright 2011, John Resig
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Includes Sizzle.js
@stevetranby
stevetranby / snippet.cpp
Created March 29, 2012 05:49
call lua functions from c++ using with Cocos2dx
CCLOG("running scripts");
//test2p
lua_State *L = pEngine->getLuaState();
lua_getglobal(L, "test");
lua_call(L, 0, 0);
lua_getglobal(L, "test1r");
lua_call(L, 0, 1);
int ret = lua_tointeger(L, -1);
@quietlynn
quietlynn / dependency_loader.user.js
Created May 9, 2012 15:51
dependency_loader.user.js => Load everything needed in userscripts.
/*
dependency_loader.user.js => Load everything needed in userscripts.
Copyright (C) 2012 Jingqin Lynn
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@reee
reee / rateat
Last active November 26, 2017 07:47
Redirect All Traffic Except Asia Traffic
#!/bin/sh
#create a new chain named SHADOWSOCKS
iptables -t nat -N SHADOWSOCKS
# Ignore your shadowsocks server's addresses
# It's very IMPORTANT, just be careful.
iptables -t nat -A SHADOWSOCKS -d 163.44.132.189/32 -j RETURN
iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/8 -j RETURN
@gabrielemariotti
gabrielemariotti / MainActivity.java
Last active February 15, 2021 17:32
How to obtain a CardView (support library) with a Image and rounded corners for API<21
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image);
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
//Default
imageView.setBackgroundResource(R.drawable.rose);
} else {
//RoundCorners
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap,
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius
@noodles-v6
noodles-v6 / 1
Created September 28, 2012 16:08
Perl中文匹配
!/usr/bin/perl
use strict;
use warnings;
use utf8;
use open ":encoding(utf8)",":std";
open my $infh, "<:encoding(utf8)", "zh.dat" or die $!;
while (<$infh>) {
@mendelgusmao
mendelgusmao / gist:5823291
Last active March 28, 2021 08:08
BTSync / BitTorrent Sync behind nginx
# take one
# subdirectory (one server, multiple services)
location /btsync/ {
rewrite ^/btsync/gui(.*) /btsync$1 last;
proxy_pass http://127.0.0.1:8888/gui/;
proxy_redirect /gui/ /btsync/;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@lotem
lotem / luna_pinyin.custom.yaml
Last active May 29, 2021 13:21
在【朙月拼音】裏使用Emoji表情(這份配置已過時,新的emoji實現代碼在 https://github.com/rime/rime-emoji
# luna_pinyin.custom.yaml
#
# 在【朙月拼音】裏使用Emoji表情(這份配置已過時,新的emoji實現代碼在 https://github.com/rime/rime-emoji )
#
# 保存到Rime用戶文件夾後,重新部署生效
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
#
# 如果目標文件已經包含其他修改內容,只需按照縮進合併 patch: 以下的部分