Skip to content

Instantly share code, notes, and snippets.

View panghea's full-sized avatar

Tadayuki Tanigawa panghea

View GitHub Profile
@a-m-s
a-m-s / MediaDecoder.java
Last active February 19, 2023 06:54
Android code to extract raw audio from arbitrary media files.
/* MediaDecoder
Author: Andrew Stubbs (based on some examples from the docs)
This class opens a file, reads the first audio channel it finds, and returns raw audio data.
Usage:
MediaDecoder decoder = new MediaDecoder("myfile.m4a");
short[] data;
while ((data = decoder.readShortData()) != null) {
@deton
deton / tsf-vim-vac2012.markdown
Last active April 20, 2024 03:40
Vi風操作をWindows用IMEとして実装
@darkfall
darkfall / gist:2760319
Created May 21, 2012 02:33
Cocos2dx PopScene with Transition
template<typename T>
void CCDirector::popSceneWithTransition(float t) {
CCAssert(m_pRunningScene != NULL, "running scene should not null");
m_pobScenesStack->removeLastObject();
unsigned int c = m_pobScenesStack->count();
if (c == 0) {
end();
}
@Dither
Dither / cssify.js
Created February 25, 2012 17:38
Convert XPath to CSS selector
// JavaScript function for converting simple XPath to CSS selector.
// Ported by Dither from [cssify](https://github.com/santiycr/cssify)
// Example: `cssify('//div[@id="girl"][2]/span[@class="body"]//a[contains(@class, "sexy")]//img[1]')`
var sub_regexes = {
"tag": "([a-zA-Z][a-zA-Z0-9]{0,10}|\\*)",
"attribute": "[.a-zA-Z_:][-\\w:.]*(\\(\\))?)",
"value": "\\s*[\\w/:][-/\\w\\s,:;.]*"
};