Skip to content

Instantly share code, notes, and snippets.

View mazikwyry's full-sized avatar
🍔

Adam Mazur mazikwyry

🍔
  • Global App Testing
  • Wyry
View GitHub Profile
@mazikwyry
mazikwyry / finish_algorythm.rb
Created October 25, 2012 11:14
Finish pitches algorythm
if cf_min_reached? and ci_min_reached?
if pitch_goal_reached?
#Combination is successful
else
if cf_goal_reached?
#CF is successful
elsif ci_goal_reached?
#CI is successful
else
#All fails
@mazikwyry
mazikwyry / emotka
Last active December 14, 2015 12:58
[:->]--)--{
@mazikwyry
mazikwyry / Error and question
Last active December 16, 2015 02:29
Old reqest and new one
NoMethodError (undefined method `[]' for nil:NilClass):
app/controllers/payments/google_checkout_controller.rb:36:in `notifications'
36: payment = GoogleCheckout.find_by_authorization(notification.shopping_cart.private_data["token"])
# We send command with shopping_cart.private_data = {token: token}
# And never have problems with getting private_data["token"] from new_order_notification
# There is no private_data["token"] in new reqest that we receive since april and here is the problem
@mazikwyry
mazikwyry / gist:6078958
Created July 25, 2013 11:49
optymilzacja
@contacts = User.fetch_contacts("Linkedin", current_user) //lista kontaktw
@tmps = @contacts.map { |tmp| tmp[:id] } //wybieramy z nij liste idków
@registered = Authentication.where("uid IN (:uids)", :uids => @tmps) //szukamy userów o takich idkach w bazie (to chyba zajmuje najwięcej czasu)
@contacts.delete_if{|contact| @registered.pluck(:uid).include?(contact[:id])} // wyrzucamy z kontaktów te znalezione w bazie
@registered.map! { |auth| auth.user }
@registered = ContactsInviterController::remove_invited @registered, current_user
@mazikwyry
mazikwyry / gist:8111620
Created December 24, 2013 10:52
cancel transaction
def cancel
update_attribute(:status, "canceled")
if payment.is_a(GoCardless) && payment.status=="preauth"
pre_auth = GoCardless::PreAuthorization.find(payment.authorization)
pre_auth.cancel!
end
end
@mazikwyry
mazikwyry / rails console
Created January 30, 2014 07:23
Faker script
reload!
Profile.find(:all).each do |u|
u.update_attribute(:first_name, Faker::Name.first_name+" "+u.id.to_s)
u.update_attribute(:last_name, Faker::Name.last_name)
end
@mazikwyry
mazikwyry / job_offer.cpp
Last active August 29, 2015 14:02
Job Offer C++
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Data;
using namespace System::Collections::Generic;
namespace JobOffer {
bool checkApplicant(JobApplicant^ applicant){
if( applicant->languageExpirience.Contains("C++") &&
en:
board:
destroy: "Delete"
add_comment: Add comment
hide_users_post: "Hide users post"
view_more_comments: "View more comments..."
comment: Comment
wait: Wait...
share: Share
share_also: SHARE ASLO ON
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: ModulePath = [C:\$Windows.~BT\Sources]
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: WorkingPath = [C:\$Windows.~BT\Sources]
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: LoggingPath = [C:\$Windows.~BT\Sources\Panther]
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: MediaPath = [F:]
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: InstallFilePath = [F:\Sources\Install.wim]
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: WinReFilePath = []
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: ServicingStackFilePath = []
2015-02-10 21:03:50, Info MOUPG SetupHost::Initialize: CmdLine = [/Install /Media /ProcessId 4604 /InstallFile
var SocialLogins = {
facebook: function(callback){
hello.login('facebook', {scope: 'email, user_friends, publish_actions'}, function(data){
$.cookie('facebook_oauth_token', data.authResponse.access_token, { expires: 7, path: '/' });
callback();
});
},
twitter: function(callback){
hello.login('twitter', {}, function(data){
$.cookie('twitter_oauth_token', data.authResponse.access_token, { expires: 7, path: '/' });