Skip to content

Instantly share code, notes, and snippets.

@jls
jls / gist:3041591
Created July 3, 2012 18:25
Cocos2d-x Static Constructor Macro
#define STATIC_CONSTRUCTOR(className, methodPostfix, methodArgs, initArgs, constructorArgs) \
static className* create ## methodPostfix methodArgs \
{ \
className *instance = new className constructorArgs; \
if (instance && instance->init ## methodPostfix initArgs) \
{ \
instance->autorelease(); \
} \
else \
{ \
@jls
jls / remove_ds_store_files.sh
Created April 15, 2012 00:45
Remove all of the .DS_Store files in the current directory and all sub directories.
find ./ -type f | grep .DS_Store | xargs rm
@jls
jls / punndit_example_worldnow.js
Created October 5, 2011 14:40
PunnBar with Worldnow example
// Flag indicating that the punndit bar has
// already been loaded and initialized at least once.
var punnditLoaded = false;
// The WGNCustomAdHandler is going to be fired when the
// media in the WN player changes. The specific event we
// are interested in is the NewMedia event. It is fired
// whenever a pre-roll, clip and post-roll video is started.
@jls
jls / example_pndt_jwplayer_dynamic.html
Created September 16, 2011 19:52
Example Punndit Embed for JW Player with Dynamic Video Changing
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JW Player Example - With Dynamic Video Changes</title>
<!-- Stylesheet for the Punndit Bar -->
<link rel="stylesheet" href="http://cdn.punndit.com/stylesheets/bar.css" type="text/css" media="screen" charset="utf-8" id="pndt-bar-css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>
<script type='text/javascript' src='./jwplayer.js'></script>
@jls
jls / example_punndit_jwplayer.html
Created August 30, 2011 15:39
Example Punndit Embed for JW Player
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JW Player</title>
</head>
<body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type='text/javascript' src='./jwplayer.js'></script>
@jls
jls / punndit_bar_embed_example.html
Created August 18, 2011 19:52
Example Punndit Embed
<!--
This following lines should be placed at the location on your page where you would
like the punndit player to appear.
The data-punn-id attribute should be any value that will uniquely
identify the video you are attaching the punndit bar to.
For example if you were attaching the bar to a YouTube video
data-punn-id could be set to the URL of the YouTube video.
-->
var app = $.sammy(function(){
this.element_selector = '#content';
this.get(/\#!\/(.*)/, function(context){
this.partial('/' + this.params['splat']);
});
});
$(document).ready(function(){
app.run('#!/');
// We will setup all of our links in the
var app = $.sammy(function(){
this.element_selector = '#content';
this.get(/\#!\/(.*)/, function(context){
this.partial('/' + this.params['splat']);
});
});
$(document).ready(function(){
app.run('#!/');
});
<% @channel.articles.each do |article| %>
# all values of the article are available here
<% end -%>
# /usr/lib/ruby/gems/1.8/gems/zencoder-2.1.13/lib/zencoder/http.rb
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
# DAMMIT! Or you can just read the docs and figure out you can do this...
Zencoder::HTTP.default_options.merge!(:skip_ssl_verify => true)