This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Facebook All Pages --> | |
<script> | |
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? | |
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; | |
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; | |
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, | |
document,'script','https://connect.facebook.net/en_US/fbevents.js'); | |
fbq('init', {{WCA}}); | |
fbq('track', "PageView", { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
re = /([^&=]+)=?([^&]*)/g | |
decodeRE = /\+/g | |
decode = (str) -> decodeURIComponent(str.replace(decodeRE, " ")) | |
assign = (obj, keyPath, value) -> | |
for i in [0...keyPath.length] | |
key = keyPath[i] | |
obj[key] = {} if !(key in obj) | |
obj = obj[key] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handles click on the button "🞮" - delete photo | |
class DelPhoto { | |
constructor(html_node) { | |
this.$btn = $(html_node) | |
this.btn_id = this.$btn.attr("id") | |
this.$photo_div = $('#'+this.btn_id.split('photo_delete_').join('photo_')) | |
this.ajaxSuccess = this.ajaxSuccess.bind(this) | |
this.check() | |
this.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":75,"titleEn":"Dominican Republic"},{"id":101,"titleEn":"Congo, Democratic Republic"},{"id":213,"titleEn":"Central African Republic"},{"id":215,"titleEn":"Czech Republic"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_to_invite = User.find(email: "peter.muster@test.com") | |
user_to_invite.deliver_invitation | |
token = user_to_invite.raw_invitation_token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# g limits the number of displayed digits | |
"%.2g" % 1.234 # => 1.2 | |
"%.2g" % 123 # => 1.2e+02 | |
"%g" % 1000000000 # => 1e+09 | |
# combined | |
"%g" % ("%.2f" % 2) #=> 2 | |
"%g" % ("%.2f" % 2.50) #=> 2.5 | |
"%g" % ("%.2f" % 12.543) #=> 12.54 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We have a policy of not adding new methods to Ruby | |
core classes unless it would benefit the framework | |
implementation or the large majority of | |
applications. For most cases I believe the required | |
keyword arguments are enough. This is actually the | |
case for assert_valid_keys as well since we can | |
change most calls to this method to keyword | |
arguments. To introduce this to 6.2 we need to show | |
that this would be useful for the framework, and | |
only two places don't are not enough. If you want |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rubocop's Metrics/AbcSize metric is disabled for | |
# this method as Rubocop determines this method to | |
# be too complex while there's no way to make it | |
# less "complex" without introducing extra methods | |
# (which actually will make things _more_ complex). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts Readline::HISTORY.to_a |