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 DataImport < ApplicationRecord | |
belongs_to :company, optional: true # org in this case | |
belongs_to :user # employee in this case | |
enum status: %i[pending processing completed failed] | |
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
#!/bin/bash | |
APPNAME="$1" | |
REMOTE="$2" | |
if [[ "$3" != "" ]]; then | |
ENVIRONMENT="$3" | |
else | |
ENVIRONMENT="development" | |
fi |
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
require 'uri' | |
require 'net/http' | |
class ExampleController < ApplicationController | |
def test_smartline | |
url = URI("https://smartlinedesign.quickbase.com/db/bngiubrjh?a=API_ImportFromCSV&ticket=9_bnhq59q6c_b3nhzn_irxj_a_-b_dgzffhkd5iim4bdnppgpdbs78vct64nqkdf97a28cfbqezkda565cd_jd3u8z") | |
http = Net::HTTP.new(url.host, url.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<!-- ... --> | |
</head> | |
<body> | |
<!-- ... --> | |
<!DOCTYPE html> |
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
# override in production... | |
if ENV['STRIPE_KEY'] | |
Rails.logger.warn "Using production environment keys for Stripe." | |
STRIPE_KEY = ENV['STRIPE_KEY'] | |
STRIPE_PUBLISH = ENV['STRIPE_PUBLISH'] | |
else | |
Rails.logger.warn "Using test keys for Stripe." | |
# dev values... |
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
Calling abort on jQuery (1.11.1) will result in an exception: | |
SyntaxError: JSON Parse error: Unexpected identifier "undefined" | |
Test case: | |
$.get('http://jsonip.com').abort(); |
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
$("input[data-role='tagsinput']").each(function() { | |
var placeholder = $(this).data('placeholder'); | |
var saved = $(this).data('saved'); | |
var autocomplete = jQuery(this).data('autocomplete'); | |
jQuery(this).select2({ | |
tags: true, | |
placeholder: placeholder, | |
minimumInputLength: 1, | |
ajax: { |
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
@mixin all-retina-sprites($map, $map2x) { | |
@media (min--moz-device-pixel-ratio: 1.5), | |
(-o-min-device-pixel-ratio: 3/2), | |
(-webkit-min-device-pixel-ratio: 1.5), | |
(min-device-pixel-ratio: 1.5), | |
(min-resolution: 1.5dppx) { | |
$base-class: sprite-map-name($map); | |
.#{$base-class}-all-retina-sprites { |
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
//Receiving the transaction response | |
-(void)transactionResults:(id)response | |
{ | |
if ([[response objectForKey:@"Transaction status"] isEqualToString:@"Approved"]) | |
{ | |
NSLog(@"Transaction Approved"); | |
NSLog(@"PNR ref: %@", [response objectForKey:@"PNFRef"]); | |
NSLog(@"Invoice: %@", [response objectForKey:@"Invoice"]); | |
NSLog(@"Card Type:%@", [response objectForKey:@"CardType"]); | |
} |
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
//Initialization - replace these values with your own account information | |
[[PATransactionHandler dataHolder] setDelegate:self]; | |
[[PATransactionHandler dataHolder] setMerchantId:@"<mid>"]; | |
[[PATransactionHandler dataHolder] setLoginId: @"<login id>"]; | |
[[PATransactionHandler dataHolder] setUserName: @"<username>"]; | |
[[PATransactionHandler dataHolder] setPassWord: @"<password>"]; | |
[[PATransactionHandler dataHolder] setAppName: @"iPad Test"]; | |
//Customization | |
[[PATransactionHandler dataHolder] setBackgroundImage:[UIImage imageNamed:@"background.png"]]; |
NewerOlder