This file contains hidden or 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
App.competition = App.cable.subscriptions.create "CompetitionChannel", | |
connected: -> | |
# Called when the subscription is ready for use on the server | |
disconnected: -> | |
# Called when the subscription has been terminated by the server | |
received: (data) -> | |
# Decision that the message that comes is a message that is sent during the competition | |
if data["type"] == "roast" |
This file contains hidden or 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 React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Image, | |
TextInput, | |
Button, | |
AsyncStorage, | |
} from 'react-native'; |
This file contains hidden or 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 React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Image, | |
TextInput, | |
Button, | |
AsyncStorage, | |
AppRegistry, |
This file contains hidden or 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 React from 'react'; | |
import { AppRegistry, StyleSheet, Text, View, AsyncStorage } from 'react-native'; | |
import { StackNavigator } from 'react-navigation'; | |
import HomeScreen from './screens/HomeScreen'; | |
import UserScreen from './screens/users/UserScreen'; | |
export default class App extends React.Component { | |
async getId() | |
{ |
This file contains hidden or 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 React from 'react'; | |
import { | |
Image, | |
Platform, | |
ScrollView, | |
StyleSheet, | |
Text, | |
TouchableOpacity, | |
View, | |
TextInput, |
This file contains hidden or 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
Competition.joins("LEFT JOIN keywords_and_users ON keywords_and_users.user_id = #{session[:user_id]}").where(id: CompetitionsAndKeyword.where(keyword_id: KeywordsAndUser.where(user_id: session[:user_id]).pluck(:keyword_id)).pluck(:competition_id)).order("(interested / views) * keywords_and_users.score DESC") |
This file contains hidden or 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
Marketer.find(Marketer.joins("LEFT JOIN users ON users.id = #{session[:user_id].to_s}", "LEFT JOIN keywords_and_users ON keywords_and_users.user_id = users.id", "LEFT JOIN matchings ON matchings.user_id = users.id AND matchings.marketer_id = marketers.id", "LEFT JOIN marketers_and_keywords ON marketers_and_keywords.marketer_id = marketers.id").where(display: [2, 3], id: MarketersAndKeyword.where(keyword_id: Keyword.find(KeywordsAndUser.where(user_id: session[:user_id]).pluck(:keyword_id))).pluck(:marketer_id)).order("CASE WHEN matchings.id is null THEN marketers.cpm * keywords_and_users.score ELSE marketers.cpm * (keywords_and_users.score / 4) END DESC").pluck(:id).uniq).first |