Skip to content

Instantly share code, notes, and snippets.

View typeoneerror's full-sized avatar
🤠
iOS, Capacitor, Ember, Vue, Rails

Benjamin Borowski typeoneerror

🤠
iOS, Capacitor, Ember, Vue, Rails
View GitHub Profile
%p - Meridian indicator (``AM'' or ``PM'')
%P - Meridian indicator (``am'' or ``pm'')
def narrow_by_tag(title, spotlist_id = 0, count = 0)
tag_id = "narrow-bg-#{spotlist_id}"
content_tag :li do
content_tag :a, :href => url do
content = check_box_tag tag_id
content << title
content << content_tag :span, :class => 'counter' { count }
end
end
end
def dots_tag(count)
content = (1..count).collect do |i|
content_tag(:li) do
content_tag(:a, :href => '#', :id => "dot-#{i}") do
"Feature #{i}"
end
end
end
content.join('\n')
end
@typeoneerror
typeoneerror / lockscroll.coffee
Created July 3, 2012 19:14
lockscroll.coffee
lockscroll = true
$('.scroll-pane').each () ->
$(this).bind 'mousewheel', (event) ->
if $(this).outerHeight() + api.getContentPositionY() >= api.getContentHeight() or api.getContentPositionY() == 0
event.preventDefault() if lockscroll
@typeoneerror
typeoneerror / recursive-chmod-no-svn.sh
Created August 26, 2012 19:16
Find files and folders that aren't .svn and chmod them.
# List files
find . -name .svn -prune -o -type f -print;
# List directories
find . -name .svn -prune -o -type d -print;
# Execute chmod for files
find . -name .svn -prune -o -type f -exec chmod 644 {} \;
# Execute chmod for directories
-- handle special cases like iPad retina
DPI_SCALE = 1
if Util.isIPadRetina () then
print ( "Why, iPad Retina; what big pixels you have." )
DPI_SCALE = 2
DISPLAY_WIDTH = 1024
Process: moai [13803]
Path: /Users/USER/*/moai
Identifier: moai
Version: ???
Code Type: X86 (Native)
Parent Process: bash [13802]
User ID: 501
Date/Time: 2013-01-29 22:07:31.561 -0800
OS Version: Mac OS X 10.8.2 (12C3103)

To start, we have a channelPlaying bool, which is passed as a "reference" to isPlaying using the syntax &channelPlaying. This seems to be somewhat a matter of style, but there are differences, though FMOD's examples uses the & version, so I've updated it to that one.

Secondly, FMODExChannel::isPlaying is the definition of a member function on the FMODExChannel. We call that with instance->isPlaying(), not instance::isPlaying() (which would be for a class function, afaik). Both references and class/instance operators seem to be similar to PHP style, which makes sense.

- bool *channelPlaying;
- self->mChannel::isPlaying(channelPlaying);
- bool isPlaying = self->mPlayState == PLAYING && *channelPlaying;
+ FMOD_RESULT result = FMOD_OK;
/********* OpenUrl.h Cordova Plugin Header *******/
#import <Cordova/CDV.h>
@interface OpenUrl : CDVPlugin
- (void)openUrl:(CDVInvokedUrlCommand*)command;
@end