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
# deserialze tag params, idea is to check for tag save/change, always update to newest params | |
# find all tags associated with beacon, transform to array and return to the controller | |
def self.deserialize_tag_parameters(params) | |
if !params[:beacon][:tags].nil? | |
if !params[:beacon][:tags].empty? | |
code_array = params[:beacon][:tags].split(',') | |
logger.debug "Tag params parsed out" + code_array.to_s | |
tags = Tag.where(:code.in => code_array) | |
end | |
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
public static class StringExtensions | |
{ | |
public static string Truncate(this string value, int maxLength) { | |
if (!string.IsNullOrEmpty(value) && value.Length > maxLength) { | |
return value.Substring(0, maxLength); | |
} | |
return value; | |
} | |
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
// | |
// DataModel.h | |
// ShoppingHelper | |
// | |
// Created by Corey Schaf on 1/2/13. | |
// Copyright (c) 2013 blaQk SHeep. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.SocialPlatforms; | |
using UnityEngine.SocialPlatforms.GameCenter; | |
public class GameCenter : MonoBehaviour { | |
static ILeaderboard m_Leaderboard; | |
public int highScoreInt = 1000; | |
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
<% flash.each do |name, msg| %> | |
<% if msg.class == Array %> | |
<% msg.each do |message| %> | |
<%= content_tag :div, message, :id => "flash_#{name}" %> | |
<% end %> | |
<% else %> | |
<%= content_tag :div, msg, :id => "flash_#{name}" %> | |
<% end %> | |
<% 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
using UnityEngine; | |
using System.Collections; | |
using System.ComponentModel; | |
using System.Net; | |
using System.IO; | |
using System.Text; | |
namespace PulsarApp{ | |
public class Pulsar : Singleton<Pulsar> { |
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
PulsarManager = new Pulsar(); | |
PulsarManager.Initialize("API_KEY", "APP_KEY"); | |
string testData = @"{ | |
""app"": ""my game"", | |
""version"" : ""0.0.1"", | |
""game"" : { | |
""level"" : ""1""}} "; | |
StartCoroutine(PulsarManager.AddEventMessage("1", testData)); |
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
select order_Id from [order] o where( | |
o.order_id in ( | |
select osh.order_id | |
from order_status_history osh | |
join order_status os on os.status_id = osh.status_id | |
inner join ( | |
select order_id, MAX(effective_date) as updated | |
from order_status_history | |
group by order_id) as status on osh.order_id = status.order_id and osh.effective_date = status.updated |
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
module ApiHelper | |
include Rack::Test::Methods | |
def app | |
Rails.application | |
end | |
end | |
RSpec.configure do |config| | |
config.include ApiHelper, api: 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
class CreateApps < ActiveRecord::Migration[5.2] | |
def change | |
create_table :apps do |t| | |
# Name of our app, used for visual readability. | |
t.string :name, unique: true | |
# Internal identifier of our app, for communication from the open api endpoint | |
t.string :token, unique: true | |
# Switch to determine if this app is currently accepting data. |
OlderNewer