Skip to content

Instantly share code, notes, and snippets.

@Illvili
Illvili / ps-color.reg
Last active December 22, 2015 04:48
PowerShell Colors for http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs NOTICE: color format OOGGRRBB
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe]
; black 00000000
"ColorTable00"=dword:00202020
; darkgreen 00008000
"ColorTable01"=dword:004e4224
; darkred 00800000
"ColorTable02"=dword:001a5d14
; darkyellow 00808000
@Illvili
Illvili / archive_log
Created September 16, 2013 08:33
ThinkPHP log archiver
#!/bin/sh
log_path="/home/www/[APP_NAME]/App/Runtime/Logs"
archive_path="/home/logs_archiver";
# some command
list_all_pattern="ls $log_path/13_*.log -1 | xargs -n 1 -I %_ basename %_ .log"
# archive files
Archive_Files () {
@Illvili
Illvili / app-icon-gen.php
Last active August 29, 2015 14:08
iOS App asset catalogs gen
<?php
if (!isset($argv[1])) {
echo '[!] Need image path', PHP_EOL;
echo $argv[0], ' [imagepath]', PHP_EOL;
exit(1);
}
$image = realpath($argv[1]);
@Illvili
Illvili / gist:8b3557c880cd325b8624
Created December 19, 2014 08:12
Fix srcset on Chrome http over TLS
if ('https:' == self.location.protocol && /chrome/i.test(window.navigator.userAgent)) {
var srcset_elements = document.querySelectorAll('[srcset]');
if (!!window.devicePixelRatio && window.devicePixelRatio != 1) {
Array.prototype.forEach.call(srcset_elements, function (el) {
var prop = el.getAttribute('srcset');
var src_list = prop.split(/,\s*/);
var ratio = 0;
var src = '';
src_list.forEach(function(item) {
@Illvili
Illvili / collapsible-fix.css
Last active August 29, 2015 14:13
collapsible-fix
.mw-collapsible.wikitable {
display:table;
}
.mw-collapsible.wikitable img {
max-width:100%;
}
.mw-collapsible > tbody > tr:first-child > th {
position:relative;
padding-left:3em;
}
@Illvili
Illvili / moegirl-mainpage-mobile-style.css
Created February 5, 2015 03:42
moegirl-mainpage-mobile-style.css
@media screen and (max-width: 1023px) {
/* MainPage restyle */
#moegirl-content > [style="position:relative; background-color:transparent; margin: 0 -1em;"] {
margin: 0 10px !important;
}
#mainpage {
width: auto;
}
#mainpage .mainpage-newsbox, #mainpage .mainpage-box {
float: none;
@Illvili
Illvili / qr-download.php
Last active October 29, 2015 09:55
APP QR Download Detect
<?php
// 地址配置
$iOSAPPStoreLink = '[iOS APP Store Link here]';
$AndroidLink = '[APK Link here]';
function redirect($url) {
header('Location: ' . $url);
exit();
}
@Illvili
Illvili / rank.all.js
Created March 2, 2015 07:19
Moegirl iOS APP Statics Rank Style
!function(){$(function(){$(".moe-group").each(function(){var o,r=$(this),e=parseInt(r.children(".moe-rank").text()),n=parseInt(r.children(".moe-prev").text());if(isNaN(n))o="fresh";else switch(Math.sign(e-n)){case-1:o="up";break;case 0:o="eq";break;case 1:o="down"}r.children(".moe-rank").addClass(o).prepend('<span class="rank-diff-icon"></span>')}),$("head").append('<style>.moe-rank .rank-diff-icon{position:relative;display:inline-block;margin-right:.5em;width:1em;height:1em;line-height:1em;border-radius:100%;text-align:center;color:#fff;vertical-align:-2px;box-sizing:border-box}.moe-rank.up .rank-diff-icon{background-color:#f94343}.moe-rank.down .rank-diff-icon{background-color:#11ba47}.moe-rank.eq .rank-diff-icon{background-color:#43a5f9}.moe-rank.fresh .rank-diff-icon{background-color:#f94343}.moe-group:nth-child(1) .rank-diff-icon{border:1px solid #eaad2b;background-color:#f4bc45;box-shadow:#f4bc45 0 0 5px}.moe-group:nth-child(2) .rank-diff-icon{border:1px solid #a0a0a0;background-color:#cdcdcd;box-shadow
@Illvili
Illvili / html5mp3.php
Created March 3, 2015 03:44
MW mp3 resolve file url
<?php
if ( ! defined( 'MEDIAWIKI' ) )
die();
/*******************************************************************************
* *
* HTML5MP3 Extension is base on FlashMP3 *
* *
* FlashMP3 Extension by Matthias Korn to embed a flash player with mp3-files *
@Illvili
Illvili / moegirl-hide-common-box.js
Last active August 29, 2015 14:17
moegirl hide common box
$(function () {
if (window.mw && !!mw.config.get('wgNamespaceNumber')) return;
var contentParent = $('#mw-content-text');
if (!contentParent.length) contentParent = $('#content');
var commonBoxes = contentParent.find('.common-box');
if (!commonBoxes.length) return;
var commonBoxContainer = $('<div id="commonBoxContainer"><div id="commonBoxInfo"></div></div>').prependTo(contentParent);
var commonBoxList = $('<div id="commonBoxList"></div>').appendTo('#commonBoxInfo');