Skip to content

Instantly share code, notes, and snippets.

@glinesbdev
glinesbdev / gist:3fa9f238e2781cc5af90
Last active August 29, 2015 14:07
Big Germany Ticket
Fixed:
In order to prevent people from accidently entering a wrong paypal adress, there should be a second field with an error
message if the paypal adress is not the same one. Is that possible? I know that we get an error message if after a successful
project we we try to transfer money to a paypal account that´s not existing - but a double field would be good in the unlikely
(but still possible) event that someone accidentaly enters a wrong paypal adress which IS actually existing, but does not
belong to him.
After sending project in you get the message: "Thanks! Your project is being reviewed by our staff.
Please allow up to 72 hours. You will receive an email from us when the review is complete.“
@glinesbdev
glinesbdev / gist:39042a32a04eb675e81f
Created October 24, 2014 20:40
Backend ECF Work
Preface: Some of this may not be backend. I am just including anything that MAY need work from the backend then we can flesh out what can be fixed on the front end.
1. Supporting as a guest (without login) -> after chosing a pledge, the adress fields vanish but then on „weiter“ (continue) there´s an error message to fill them in and they reappear. This game can be played forever and will be a reason to cancel the transaltion in the middle
2. After chosing a reward youre prompted to login, after logging in you STILL get to the welcome page but you NEED to go back to the page where you left of. We´ve already send this error in a few times and for weeks, this needs to be fixed.
3. There needs to be an error message when someone tries to support with an uneven amount (12,50) that only full euros can be pledged („Du kannst nur mit vollen Eurobeträgen unterstützen.“)
4. ...connected to this error: payments that do not go through (because people didn´t have a credit card connected to their account and broke of t
@glinesbdev
glinesbdev / gist:50c2b2f422ad8d9d5f2c
Last active August 29, 2015 14:08
Theme File Breakout
I did some research on and figured out how we can drastically reduce the amount
of customizations we deal with for each portal. I checked Shopify’s file structure
and figured out how they do it.
This email is going to describe how I think the assets and the code
belonging to said assets on the portal, specifically CSS and JavaScript,
should be handled on our platforms. I will describe how it is being used
today and how we should be using it.
How are we using CSS and JavaScript right now?
Add this code to application.html before the closing </header> tag:
<div class="beta">
<p>BETA</p>
</div>
Then add these styles to the same page:
<style>
.beta {
width: 0;
@glinesbdev
glinesbdev / piratebadge.dart
Created December 2, 2014 15:54
Pirate Name Badge Dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'dart:math' show Random;
import 'dart:convert' show JSON;
ButtonElement genButton;
final String TREASURE_KEY = 'pirateName';
@glinesbdev
glinesbdev / gist:1dbf85dec77b29056a4e
Created January 6, 2015 17:47
Custom Field Working Example
<div class="control-group integer required {% if form.errors contains 'financials' %}error{% endif %}">
<label class="integer required control-label" for="project_financials"><abbr title="required">*</abbr> Financials</label>
<div class="controls input-prepend">
<textarea class="numeric integer required input-medium tinymce" id="project_financials" name="project[custom_attributes][financials]" step="1" {% if disabled %}disabled{% endif %}>{{ project.financials }}</textarea>
{% if form.errors contains 'financials' %}<p class="help-inline">{{ form.error_messages['financials'] }}</p>{% endif %}
</div>
</div>
// [declare namespace]
var FourLife = FourLife || {};
// [declare module]
FourLife.PalindromeChallenge = (function() {
// [strict mode]
'use strict';
// [private variable(s)]
var _splitStr = [],
@glinesbdev
glinesbdev / String count hash Ruby
Created May 11, 2015 20:16
String count hash Ruby
def key_val_count(string)
obj = {}
string.each_char { |x| obj[x] = x.size }
puts obj
end
key_val_count('hello')
# => {"h"=>1, "e"=>1, "l"=>1, "o"=>1}
@glinesbdev
glinesbdev / routes.rb
Last active August 29, 2015 14:21
Rake routes
Prefix Verb URI Pattern Controller#Action
root GET / application#index
documentation GET /documentation(.:format) application#documentation
large_monsters GET /api/v1/large_monsters(.:format) large_monsters/large_monster#index {:format=>"json"}
GET /api/v1/large_monsters/:id(.:format) large_monsters/large_monster#show {:format=>"json"}
GET /api/v1/large_monsters/:large_monster_id/armor(.:format) large_monsters/armor#index {:format=>"json"}
GET /api/v1/large_monsters/:large_monster_id/armor/:id(.:format) large_monsters/armor#get_one {:format=>"json"}
GET /api/v1/large_monsters/:large_monster_id/weapons(.:format) large_monsters/weapons#get_all {:format=>"json"}
GET /api/v1/large_monsters/:large_monster_id
@glinesbdev
glinesbdev / ajax.js
Last active August 29, 2015 14:21
Basic Ajax
$.ajax({
method: 'GET',
url: 'http://mh4u-api.com/api/v1/large_monster/1',
dataType: 'json',
success: function(data) {
console.log(data); // Large Monster Data with the id of '1'
}
});