Skip to content

Instantly share code, notes, and snippets.

Mike Pence mikepence

  • Florida
Block or report user

Report or block mikepence

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View für donald.clj
(require '[clojure.string :as str])
(defn rename-underscore [sym]
[(symbol (str/replace (name sym) \_ \-))
(keyword sym)])
(defn udestructure [[lhs expr]]
(if (and (map? lhs)
(vector? (:_keys lhs)))
(let [msym (gensym)
View gist:8772196
require 'active_support/concern'
module Campaign::Events
extend ActiveSupport::Concern
included do
def generate_event
Bus::Event::CampaignSubmittedForReview.create(:campaign => self)
end
end
View gist:8771915
module Campaign
class Base < ActiveRecord::Base
include Campaign::Data
include Campaign::State
include Campaign::Events
include Campaign::Presenters
include Campaign::Services
end
end
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
You can’t perform that action at this time.