Skip to content

Instantly share code, notes, and snippets.

View mkuklis's full-sized avatar
🏃‍♂️

Michał Kuklis mkuklis

🏃‍♂️
View GitHub Profile
@mkuklis
mkuklis / split jruby-complete.jar windows
Created October 20, 2009 03:33
splits jruby-complete.jar windows
del jruby-core.jar
del ruby-stdlib.jar
rd /sq tmp_unpack
mkdir tmp_unpack
cd tmp_unpack
jar xf ../jruby-complete.jar
cd ..
mkdir jruby-core
move tmp_unpack/org jruby-core/
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2-head
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2-head@rails3
@mkuklis
mkuklis / mongoid_rake.rake
Created November 12, 2010 18:12
few rake tasks to interact with mongodb via mongoid
namespace :mongo do
def confirm(message)
print "\n#{message}\nAre you sure? [y/n] "
# STDIN is not supported on heroku :/
raise 'Aborted' unless STDIN.gets.chomp == 'y'
end
desc "gets database"
task :db => :environment do
@mkuklis
mkuklis / backbone_playground.js
Created November 15, 2010 08:05
playing with backbone
$(function() {
// data comes from server
var data = {title: "header title", body: "body title", background_color: "#ffffff"};
// setup site model and extend it with data from server
var Site = Backbone.Model.extend(data);
// header view
var HeaderView = Backbone.View.extend({
@mkuklis
mkuklis / gist:743060
Created December 16, 2010 05:09
cf9 test
<cfscript>
// creates message ready for Twitter for given paramaters
function createTwitterMessage(name, amount, activity, technology, location) {
return "Help " & name & " collect " & amount & " for " & activity & " in " & location;
}
</cfscript>
@mkuklis
mkuklis / gist:743062
Created December 16, 2010 05:11
cf9 function usage
<!DOCTYPE html>
<html>
<head></head>
<body>
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://www.energyincommon.org"
data-text="<cfoutput>#createTwitterMessage("Frist Name Last Name", "$490.00", "Health Care", "Solar Home Systems", "Koni, Ghana")#</cfoutput>"
data-count="horizontal" data-via="energyincommon">Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</body>
@mkuklis
mkuklis / gist:744463
Created December 17, 2010 03:55
message for twitter/facebook
<cffunction name="createMessage">
<cfargument name="name" required="true" type="string">
<cfargument name="amount" required="true" type="string">
<cfargument name="activity" required="true" type="string">
<cfargument name="technology" required="true" type="string">
<cfargument name="location" required="true" type="string">
<cfreturn "Help " & name & " collect " & amount & " for " & technology & " (" & activity & ") in " & location>
</cffunction>
<!-- message -->
<cfoutput>#createMessage("Name", "$490.00", "Health Care", "Solar Home Systems", "Koni, Ghana")#</cfoutput>
<br /><br />
<!-- facebook -->
<a name="fb_share" share_url="http://www.energyincommon.org" type="button">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<br /><br />
<!-- twitter -->
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.energyincommon.org" data-text="<cfoutput>#createMessage("Name", "$490.00", "Health Care", "Solar Home Systems", "Koni, Ghana")#</cfoutput>" data-count="horizontal" data-via="energyincommon">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
a {
text-decoration:none;
}
a:hover {
text-decoration:none;
}