This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void drawPicture(Picture picture) { | |
picture.endRecording(); | |
native_drawPicture(mNativeCanvas, picture.ni()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# chcp 65001 | |
require 'rubygems' | |
require 'hpricot' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'yaml' | |
require 'time' | |
require 'pandoc-ruby' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usage: ruby test.rb layout/ | |
$counter =1 | |
$strs=[] | |
def gen(ctn) | |
reg = /android:text="([^@?]*?)"/ | |
while res = ctn.match(reg) | |
id = "autogen_text_#{$counter}" | |
$counter=$counter+1 | |
ctn.sub!(reg,"android:text=\"@string/#{id}\"") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
class Ruhoh | |
module Compiler | |
# the origin rss compiler is provided by David Long | |
# http://www.davejlong.com/ | |
# https://github.com/davejlong | |
# Thanks David! | |
# this rss compiler is modified by Douo | |
# use page.render_content instead of page.render |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins: | |
sitemap_generator: # all optional | |
file_name: sitemap.xml | |
exclude_id: | |
- search.html | |
- pages.html | |
change_frequency_custom_name: changefreq | |
priority_custom_variable_name: priority |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import encodings.utf_8 | |
import math | |
import urllib, urllib2 | |
import random | |
import re | |
from xml.dom import minidom | |
from LevenshteinDistance import LevenshteinDistance | |
from grabber import LyricProviderBase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Code from LyricZilla - Linux 下的滚动歌词 | |
from encodings import gb18030, utf_8 | |
import urllib | |
from xml.dom import minidom | |
from LevenshteinDistance import LevenshteinDistance | |
from grabber import LyricProviderBase | |
__all__ = 'Lyricist' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruhoh v2.5 | |
# -s 是自己扩展的命令,用来指定ruhoh的工作目录,如果没有默认是当前目录 | |
alias post='ruhoh -s "$RUHOH" posts new' | |
alias page='ruhoh -s "$RUHOH" pages new' | |
alias diary='ruhoh -s "$RUHOH" diary today' | |
alias note='ruhoh -s "$RUHOH" notes new' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tona | |
def initialize | |
@_u = ["B", "C", "C'", "D", "Ds", "E", "F", "Fs", "G", "Gs", "A", "As"] | |
@_d = ["B", "C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb"] | |
@_a = [0, 2, 2, 1, 2, 2, 2, 1] | |
end | |
["B", "C", "Cs", "D", "Ds", "E", "F", "Fs", "G", "Gs", "A", "As"].each do |t| | |
class_eval <<-RUBY | |
def #{t} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){ | |
public void onGlobalLayout() { | |
// the code from here where excute after layout is complete | |
getWindow().getDecorView().getViewTreeObserver().removeGlobalOnLayoutListener(this); | |
} | |
}); |
OlderNewer