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
| /* | |
| Android Asynchronous Http Client | |
| Copyright (c) 2011 James Smith <james@loopj.com> | |
| http://loopj.com | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
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 -*- | |
| require 'json' | |
| str = '{"a":"string","b":12,"c":2.12,"d":9223372036854775807,"e":0.142318719237491324918231415143121324,"f":[1,3,4,5,6] }' | |
| class JavaGenerator | |
| def initialize(name, config={}) | |
| @name = name | |
| @config = config |
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); | |
| } | |
| }); |
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
| # 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
| # -*- 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
| # -*- 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
| 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
| 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
| #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}\"") |