Skip to content

Instantly share code, notes, and snippets.

Mike Pence mikepence

  • Florida
View GitHub Profile
View Vimeo javascript API
<html>
<head></head>
<body>
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script>
var player = $f('player'); // You should pass player id, which is 'player'
player.api('ready', function() {
View gist:6804563
require 'java'
java_package 'com.mycompany'
java_import org.apache.wicket.request.mapper.parameter.PageParameters
java_import org.apache.wicket.markup.html.basic.Label
java_import org.apache.wicket.markup.html.WebPage
class HomePage < Java::WebPage
serialVersionUID = '1L'
View gist:6804479
public class WicketApplication extends WebApplication
{
/**
* @see org.apache.wicket.Application#getHomePage()
*/
@Override
public Class<? extends WebPage> getHomePage()
{
return HomePage.class;
}
View rmagick.sh
sudo apt-get install libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev rvm
sudo gem install rmagick
ok!
Fetching: rmagick-2.13.1.gem (100%) Building native extensions. This could take a while ... Successfully installed rmagick-2.13.1 1 gem installed
require 'RMagick' #=> true
View Gemfile
source 'https://rubygems.org'
ruby "2.0.0"
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
...
View gist:4313683
class PlacardPanelWidget < Apotomo::Widget
has_widgets do
self << widget(:project_placard, 'project_1')
self << widget(:project_placard, 'project_2')
self << widget(:project_placard, 'project_3')
self << widget(:project_placard, 'project_4')
end
def display
@mikepence
mikepence / gist:3953440
Created Oct 25, 2012
Code to fetch Facebook image for Catarse
View gist:3953440
def self.create_with_omniauth(auth, primary_user_id = nil)
u = create! do |user|
user.provider = auth["provider"]
user.uid = auth["uid"]
user.name = auth["user_info"]["name"]
user.name = auth["user_info"][:name] if user.name.nil?
user.email = auth["user_info"]["email"]
user.email = auth["extra"]["user_hash"]["email"] if auth["extra"] and auth["extra"]["user_hash"] and user.email.nil?
user.nickname = auth["user_info"]["nickname"]
user.bio = auth["user_info"]["description"][0..139] if auth["user_info"]["description"]
@mikepence
mikepence / gist:3953451
Created Oct 25, 2012
Code to fetch Facebook image for Catarse (latest code)
View gist:3953451
def self.create_with_omniauth(auth)
create! do |user|
user.provider = auth["provider"]
user.uid = auth["uid"]
user.name = auth["info"]["name"]
user.email = auth["info"]["email"]
user.email = auth["extra"]["user_hash"]["email"] if auth["extra"] and auth["extra"]["raw_info"] and user.email.nil?
user.nickname = auth["info"]["nickname"]
user.bio = auth["info"]["description"][0..139] if auth["info"]["description"]
user.locale = I18n.locale.to_s
@mikepence
mikepence / gist:1355359
Created Nov 10, 2011
Embed code for an Acts of Kindness widget
View gist:1355359
<script type="text/javascript">
var _aok = _aok || [];
// blank shows generic feed
_aok._flashtag = '';
</script>
<script type = "text/javascript" src = "http://aok.tv/widget"></script>
View gist:243593
git submodule add git://github.com/apotonick/cells
git submodule add git://github.com/apotonick/apotomo
git init
git update
You can’t perform that action at this time.