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 LaunchScreen extends React.Component { | |
goTo(route) { | |
this.refs.nav.push(route) | |
} | |
receiveRemoteNotification(notification) { | |
var onPressFollow = function() { | |
console.log("follow"); |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
*/ | |
'use strict'; | |
var PushManager = require('./RemotePushIOS'); | |
var registerInstallation = require('./Installation'); | |
var WEBVIEW_REF = 'webview'; |
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
'use strict'; | |
var React = require('react-native'); | |
var Parse = require('parse').Parse; | |
var ParseReact = require('parse-react'); | |
var DetailScreen = require('./DetailScreen'); | |
var { | |
StyleSheet, |
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
for(i = 0; i < parent_names.length; i++) { | |
if(parent_ids[i]) { | |
/* | |
content = content.replace( | |
new RegExp('(\[' + parent_names[i] + '\])\[.+?\]', 'g'), | |
'$1[' + parent_ids[i] + ']' | |
) | |
*/ | |
var regexp_string = '\\[' + parent_names[i] + '\\]\\[.+?\\]'; |
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
@event = @user.events.build(:title => params[:title], :start => params[:start], :end => params[:end]) |
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
<% unless current_user.address.nil? %> | |
<%= current_user.address.name %><br/> | |
<%= current_user.address.company %><br/> | |
<%= current_user.address.street %><br/> | |
<%= current_user.address.city %><br/> | |
<%= current_user.address.code %><br/> | |
<% end %> |
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
<p id="notice"><%= notice %></p> | |
<p> | |
<b>Title:</b> | |
<%= @document.title %> | |
</p> | |
<p> | |
<b>Body:</b> | |
<%= @document.body %> |
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 Suggestion | |
include Mongoid::Document | |
field :title, :type => String | |
field :body, :type => String | |
field :slug, :type => String | |
embeds_many :votes | |
embeds_many :features | |
#index :votes_difference | |
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
def create | |
@suggestion = Suggestion.new(params[:suggestion]) | |
# create slug - TODO move somewhere | |
@suggestion.slug = params[:suggestion][:title].parameterize | |
# adjust slug if not unique | |
i=3 | |
while !@suggestion.valid? && @suggestion.errors["slug"].include?("is already taken") | |
if @suggestion.slug[/-\d+$/].nil? # does the slug contain "-123" at the end? | |
@suggestion.slug<<"-2" # if not, assuming it's first duplicate and add "-2" |
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
# taken from http://github.com/ianwhite/pickle/blob/master/lib/pickle/adapters/active_record.rb | |
begin | |
require 'activerecord' | |
rescue LoadError | |
require 'active_record' | |
end | |
class ActiveRecord::Base | |
module PickleAdapter |
OlderNewer