Skip to content

Instantly share code, notes, and snippets.

View denysonique's full-sized avatar

Dennis Prochniak denysonique

View GitHub Profile
ome/dennis/.rvm/gems/ruby-1.9.2-p290/bin/rspec: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
-- control frame ----------
c:0001 p:0000 s:0002 b:0002 l:00124c d:00124c TOP
---------------------------
-- C level backtrace information -------------------------------------------
/home/dennis/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(rb_vm_bugreport+0x72) [0xb77100e2]
/home/dennis/.rvm/rubies/ruby-1.9.2-p290/lib/libruby.so.1.9(+0x563a1) [0xb75ea3a1]
require 'mechanize'
require 'shellwords'
agent = Mechanize.new
agent.user_agent_alias = 'Windows IE 7'
page = agent.get('https://online.lloydstsb.co.uk/personal/logon/login.jsp')
login_form = page.forms.first
login_form.send("frmLogin:strCustomerLogin_userID", "1234")
login_form.send("frmLogin:strCustomerLogin_pwd", "secret")
page = agent.submit login_form
Assuming your username is "username"
$ sudo gpasswd -a postfres username
$ sudo postgres createuser username
//wyświetla wszystkie argumenty, w nawiasie podając ich długość
int dl_napisu(char n[]) {
int i = 0;
while(n[i] != 0)
i++;
return i;
}
Titanium.UI.setBackgroundColor('#000')
tabGroup = Titanium.UI.createTabGroup()
win1 = Titanium.UI.createWindow
title:'Tab 1'
backgroundColor:'#fff'
@denysonique
denysonique / gist:1489887
Created December 17, 2011 10:26 — forked from mauriciofierrom/gist:1489885
ujs problem
def create
@cart = current_cart
product = Product.find(params[:product_id])
@line_item = @cart.add_product(product.id)
respond_to do |format|
if @line_item.save
format.html { redirect_to(store_url)}
format.js { @current_item = @line_item }
format.xml { render :xml => @line_item, :status => :created, :location => @line_item }
class Array
def to_proc
lambda { |o| o.__send__(first, *self[1..-1]) }
end
end
1.9.3-p0 :031 > [1,2,3].map(&[:+, 1])
=> [2, 3, 4]
[root@speedy dennis]# parted /dev/sda p free
Model: ATA Hitachi HTS54321 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 32.3GB 32.3GB primary boot
32.3GB 33.4GB 1081MB Free Space
3 33.4GB 160GB 127GB extended
from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route("/dashboard/<variable>")
def dashboard():
return render_template('template_file.html', variable=variable)
if __name__ == "__main__":
require 'sinatra'
require 'haml'
get '/hi/:variable' do
@variable = params[:variable]
haml :template_file
end