Skip to content

Instantly share code, notes, and snippets.

View darthdeus's full-sized avatar

Jakub Arnold darthdeus

View GitHub Profile
composite = Swt::Widgets::Shell.new(Redcar::ApplicationSWT.display, Swt::SWT::MODELESS)
layout = Swt::Layout::RowLayout.new(Swt::SWT::VERTICAL)
composite.setLayout(layout)
text = Swt::Widgets::Text.new(composite, Swt::SWT::SINGLE | Swt::SWT::LEFT | Swt::SWT::ICON_CANCEL)
text.set_layout_data(Swt::Layout::RowData.new(400, 20))
list = Swt::Widgets::List.new(composite, Swt::SWT::V_SCROLL | Swt::SWT::H_SCROLL | Swt::SWT::SINGLE)
list.set_layout_data(Swt::Layout::RowData.new(400, 200))
composite.set_size(420,280)
composite.open
x, y = Redcar.gui.dialog_adapter.send(:get_coordinates, :cursor)
@darthdeus
darthdeus / rails31init.md
Created October 19, 2011 15:32 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

product_data = [
"PE316,Zvukotesna vlozka SPIRE pro redukci hluku,104,51",
"RI080,FAN COOLER PASIVNI,491,88",
"QE091,Nabijecka PENTAGRAM Pocket USB,608,30",
"QU286,RAMECEK ViPower VYMENNY PLAST ATA,572,95",
"PU441,RAZER LYCOSA Gaming Keyboard,160,56",
"QE170,ICON,136,47",
"SE125,UTP OCHRANA KONEKTORU,310,17",
"TI390,PCI Express,415,56",
"TO120,PRINTSERVER Digitus Fast Ethernet USB,674,38",
require "rexml/document"
require "rubygems"
require "builder"
customers = []
items = []
File.open(File.dirname(__FILE__) + "/orders.xml", "r") do |file|
doc = REXML::Document.new(file)
doc.root.elements.each do |order|
order.elements.each do |element|
@darthdeus
darthdeus / LICENSE.txt
Created March 3, 2012 18:02 — forked from aemkei/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
describe 1 do
let(:foo) { [] }
it "can push" do
foo.push 1
foo.size.should == 1
end
it "can push" do
foo.push 1
@darthdeus
darthdeus / node.json
Created November 12, 2012 16:00 — forked from anonymous/node.json
{
"vim": { "extra_packages": [ "vim-nox" ] },
"run_list": ["recipe[vim]"]
}
@darthdeus
darthdeus / Bundle.sh
Created November 24, 2012 15:08 — forked from inossidabile/Bundle.sh
Joosy / Blog / Rails preparations
bundle install
Scvrush.PostsController = Em.ArrayController.extend({
query: null,
updatePosts: _.throttle(function(value) {
var posts;
if (this.get("query") === "") {
posts = Scvrush.get("store").find(Scvrush.Post);
} else {
posts = Scvrush.get("store").find(Scvrush.Post, { query: this.get("query") });
In controller:
App.DashboardController = Ember.Controller.extend
workspaces: []
currentWorkspace: null //set by /workspace/:id route
fetch: ->
//ajax load workspaces