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
<MagicInput binding={[this, 'account.owner.email']} required_emoji={true} counter={true} /> |
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
MagicInput = React.createClass | |
getInitialState: -> | |
value = @getValue() | |
if value == '' | |
empty = true | |
else | |
empty = false | |
{empty: empty} |
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
var NoLink = React.createClass({ | |
getInitialState: function() { | |
return {message: 'Hello!'}; | |
}, | |
handleChange: function(event) { | |
this.setState({message: event.target.value}); | |
}, | |
render: function() { | |
var message = this.state.message; | |
return <input type="text" value={message} onChange={this.handleChange} />; |
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
<MagicInput binding={[this, 'account.owner.email']} /> |
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
# Name your class anything you want. Here, I call it Foo. | |
# Note that by writing out our code in its own class, we namespace it. | |
class Foo | |
constructor: -> | |
# Here we just set the host to your website, but you might want to add a little variable here | |
# to make it www.staging.yourwebsite.com when you're in the staging environment and localhost:3000 | |
# when you're in the development environment. | |
@host = "www.your-website.com" | |
# Makes the base of xml requests http when we are testing on localhost. |
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
<script data-version='v1' data-client-id='clients-id' id='unique-embedder-id' type='text/javascript'> | |
// "data-version": It's useful to put the version of your embedder script in the "version" data | |
// attribute. This will enable you to more easily debug if any issues arise. | |
// "data-client-id": This id allows us to pull up the correct client's settings from our database. | |
// Each client may have different settings associated with their widget, and you can load them | |
// with this! | |
// "id": This HTML id allows us to refer to this embedder script's location. This is helpful | |
// if you want to inject html code in specific places in hour hosts's website or if you want to | |
// insert your payload script right next to this in the <head> tag. | |
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
class YourController < ApplicationController | |
before_filter :cors_preflight_check, only: [:settings] | |
after_filter :cors_set_access_control_headers, only: [:settings] | |
def settings | |
# YOUR CODE TO GET CLIENT'S WIDGET SETTINGS HERE | |
end | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' |
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
import goslate | |
import random | |
class Trans: | |
def __init__(self, language): | |
self.gs = goslate.Goslate() | |
self.language = language | |
def translate(self,word): | |
print self.gs.translate(word, self.language) |
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
var linkbuilt =""; | |
if(courseId !=undefined){ | |
linkbuilt='http://new.culturealley.com/?courseId='+courseId+'&utm_source=facebook&utm_medium=FeedStatus&utm_campaign=FBFeedStatus'; | |
}else{ | |
linkbuilt='http://new.culturealley.com/?utm_source=facebook&utm_medium=FeedStatus&utm_campaign=FBFeedStatus' | |
} | |
FB.ui({ | |
method: 'feed', | |
link: linkbuilt, | |
caption: "I started today and can already introduce myself in "+toLanguagePreference+".", |
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
function postStory() { | |
var desc = 'Click to play games and learn '+ capitalizeFirstLetter(toLanguagePreference)+' with your fun and studious friend, '+ $('.userName').text() + ', now! '+$('.userName').text() + | |
' just learnt how to say ' + | |
((toLanguagePreference.toLowerCase() == 'mandarin') ? | |
lastLearntWords[0].word + ', ' + lastLearntWords[1].word + ', ' + lastLearntWords[2].word + ', and more in ': | |
lastLearntWords[0].meaning + ', ' + lastLearntWords[1].meaning + ', ' + lastLearntWords[2].meaning + ', and more in ') + | |
capitalizeFirstLetter(toLanguagePreference) + | |
'. Give this a "like" to encourage your friend!'; | |
FB.api('app/objects/' + APP_NAMESPACE + ':word', 'POST', { | |
'access_token': APP_ID + '|' + APP_SECRET, |
NewerOlder