rails new your-store-name
gem 'spree_backend', github: 'spree/spree'
/* ================================================== | |
AJAX Register Form | |
================================================== */ | |
jQuery(function($){ | |
$("form#sign_up_user").submit(function(e){ | |
e.preventDefault(); | |
var user_info = $(this).serialize(); | |
$.ajax({ | |
type: "POST", | |
url: $(this).attr('action'), |
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
unless ARGV[0] and ARGV[1] | |
puts "Niepoprawne użycie skryptu" | |
puts "Sposób użycia: script.rb <miesiąc> <dzień>" |
js code: | |
$( document ).ready(function() { | |
function callAjax(){ | |
var xmlhttp, account; | |
xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange = function(){ | |
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ | |
account = document.getElementById("test"); | |
account.innerHTML=xmlhttp.responseText; | |
document.getElementById('delete_account').getElementsByClassName("modal-footer")[0].getElementsByClassName("btn-danger")[0].click(); |
def PERM(n) | |
puts "#{@my_array[1..-1].inspect}" | |
for i in 1..(1..n).inject(:*) | |
a = 0 | |
loop do | |
if a > 1 && a < n+1 | |
temp = @temp_array[a] | |
if a - temp > 1 | |
@temp_array[a] = temp + 1; | |
@my_array[B(a,temp+1)], @my_array[a] = @my_array [a], @my_array[B(a,temp+1)] |
#!/usr/bin/ruby | |
require 'active_support/all' | |
@a = Array(1..ARGV[0].to_i) | |
def funkcja1(i) | |
if index = @a.index(i) | |
temp = @a.take(index).combination(2).to_a.delete_if { |a| a.sum != i } | |
@a.delete(i) if temp.empty? | |
puts "Funkcja1 i: #{i}" |
puts "Podaj tekst:" | |
t = gets.chomp.split(//) | |
puts "Podaj wzorzec:" | |
p = gets.chomp.split(//) | |
n, m = t.length, p.length | |
pPos, iPos = 0, 0 | |
while iPos < n |