Skip to content

Instantly share code, notes, and snippets.

@ggshily
ggshily / gist:18bd380b5f06c6ffdccf
Created November 11, 2015 09:27
setBackgroundMusicLoop for cocos2dx
diff --git a/client/cocos2d/cocos/audio/android/cddSimpleAudioEngine.cpp b/client/cocos2d/cocos/audio/android/cddSimpleAudioEngine.cpp
index c9a78fe..65f4f3d 100644
--- a/client/cocos2d/cocos/audio/android/cddSimpleAudioEngine.cpp
+++ b/client/cocos2d/cocos/audio/android/cddSimpleAudioEngine.cpp
@@ -55,6 +55,7 @@ namespace CocosDenshion {
// Empty implementations. On Android, only subclasses are meant to be used
void SimpleAudioEngine::preloadBackgroundMusic(const char* pszFilePath) { }
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) { }
+ void SimpleAudioEngine::setBackgroundMusicLoop(bool bLoop){ };
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) { }
#!/bin/bash
echo Building Google Protobuf for Mac OS X / iOS.
echo Use 'tail -f build.log' to monitor progress.
(
PREFIX=`pwd`/protobuf
mkdir ${PREFIX}
mkdir ${PREFIX}/platform
@ggshily
ggshily / wiki2html.sh
Last active December 12, 2015 00:08
parse wiki notation to html tag
#!/bin/sh
# line start with "h1. " title 1
# line start with "h2. " title 2
# !image_url!
# [link_description|link_address]
# line start with "* " is a list
# line start with "** " is a sub list
DEBUG=1
@ggshily
ggshily / cnblogs.js
Last active December 11, 2015 21:38
redirect the content to github in cnblogs
//console.log("hello")
if(document.getElementById("cnblogs_post_body") != null)
{
var content = document.getElementById("cnblogs_post_body").textContent;
console.log(content);
if(content.indexOf("https://gist") == 0)
{
var xhr = new XMLHttpRequest();
#!/bin/sh
(( ${#} > 0 )) || {
echo 'DISCLAIMER: USE THIS SCRIPT AT YOUR OWN RISK!'
echo 'THE AUTHOR TAKES NO RESPONSIBILITY FOR THE RESULTS OF THIS SCRIPT.'
echo "Disclaimer aside, this worked for the author, for what that's worth."
echo 'Press Control-C to quit now.'
read
echo 'Re-running the script with sudo.'
echo 'You may be prompted for a password.'
sudo ${0} sudo
@ggshily
ggshily / Understanding Flash Player with Adobe Scout
Last active December 11, 2015 20:29
[翻译]Understanding Flash Player with Adobe Scout
h1. 通过Adobe Scout深入理解Flash播放器
原文:[Understanding Flash Player with Adobe Scout|http://www.adobe.com/devnet/scout/articles/understanding-flashplayer-with-scout.html]
作者:[Mark Shepherd|http://www.adobe.com/devnet/author_bios/mark_shepherd.html]
作者:[Michael Smith|http://www.adobe.com/devnet/author_bios/michael-smith.html]
转载请注明出处
Adobe Scout 是优化Flash内容异常强大的工具,因为他可以让你看到在Flash播放器里场景背后真正发生了什么.但只有当你理解了Flash播放器为什么那么做的时候那些信息才是最有用的.也只有那时候你才能有效地解决Scout告诉你的问题.
这篇文章的目的是让你对Flash播放器如何工作有一个基础的理解,并且理解与此相关的在Scout里看到的信息.这也是Scout中用到的terminology的一个指南,因此你可以找到Flash播放器执行的不同的活动的意义.如果你用过Scout并且有"我发现我的程序花了很多时间在做X上,但我不知道X是什么意思"的疑问的话,这篇文章正适合你!
注意这不是一个使用Scout界面的指南.如果你不知道如何使用Scout,或者不同的面板干什么,那么你需要读一下[开始指南|http://www.adobe.com/devnet/scout/articles/adobe-scout-getting-started.html].