Skip to content

Instantly share code, notes, and snippets.

View larvata's full-sized avatar

Larvata larvata

View GitHub Profile
@larvata
larvata / ConfigurationWrapper.cs
Created December 9, 2014 08:50
Common ConfigurationManager for app.config and web.config
using System.Collections.Specialized;
using System.Configuration;
using System.Reflection;
using System.Web.Configuration;
namespace TinyMess.Common
{
internal static class ConfigurationManagerWrapper
{
private static bool IsAspDotNet { get; set; }
@larvata
larvata / BuffWalker.cs
Created January 13, 2015 02:36
A binary reader
public class BuffWalker
{
public byte[] Buffer;
private uint _positon;
public EndiannessEnum Endianness { get; set; }
public long RestBytesCount
{
get { return this.Buffer.LongLength - _positon; }
}
@larvata
larvata / demo.coffee
Last active August 29, 2015 14:19
MeruTask 同步顺序执行异步任务
request = require 'request'
client= require('redis').createClient()
meru=require './libs/meruTask'
###
GET lastPostId FROM api (getLastPostIdFromAPI)
GET nextPostId FROM redis DEFAULTS 1 (getNextPostIdFromRedis)
LOOP:
IF nextPostId<=lastPostId (checkNewPostsAvailable)
@larvata
larvata / tampermonkey-755-contextmenu.js
Last active May 25, 2016 20:14
enable context menu for 755 images
// ==UserScript==
// @name 7gogo Image Helper
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match https://7gogo.jp/*
// @grant none
// ==/UserScript==
@larvata
larvata / bit-dice.js
Last active May 25, 2016 20:18
auto script for btc-dice
// ==UserScript==
// @name BTC-DICE
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://www.btc-dice.com/*
// @copyright 2012+, You
// ==/UserScript==
///////// CONST /////////
@larvata
larvata / tampermonkey-oricon-large-cover.js
Last active May 25, 2016 20:18
oricon Large Cover download
// ==UserScript==
// @name oricon Large Cover
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://www.oricon.co.jp/rank/*
// @copyright 2012+, You
// ==/UserScript==
$.each($(".item_img>div:first-child>a"),function(i,obj){
@larvata
larvata / JUST-DICE.js
Last active May 25, 2016 20:20
auto script for just-dice
// ==UserScript==
// @name JUST-DICE
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match https://just-dice.com/*
// @copyright 2012+, You
// ==/UserScript==
///////// CONST /////////
@larvata
larvata / tampermonkey-itunes-large-cover.js
Last active May 25, 2016 20:20
this is a Tampermonkey script for itunes.click album cover for download it as 1200x1200 resulotion.
// ==UserScript==
// @name itunes Large Cover
// @namespace https://github.com/larvata
// @version 0.1
// @description click album cover for download it as 1200x1200 resulotion.
// @match https://itunes.apple.com/*/album/*
// @copyright 2013+, Larvata
// ==/UserScript==
var artworks=document.getElementsByClassName('artwork');
@larvata
larvata / tampermonkey-google-plus-full-image.js
Last active January 31, 2017 09:34
google plus full size image
// ==UserScript==
// @name google plus full size image
// @namespace http://larvata.me/
// @version 0.1
// @description enter something useful
// @author Larvata
// @match *://*.googleusercontent.com/*
// @grant none
// ==/UserScript==
@larvata
larvata / docker-cheatsheet.md
Created March 5, 2017 08:09
my docker cheat sheet

docker cheatsheet

  1. Remove all stopped containers
docker container prune
  1. Remove all dangling images
# list