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 ZohoOrder | |
include ActiveModel::Model | |
include ActiveModel::Validations::Callbacks | |
ZohoFields = [ | |
'ID', | |
'Added_Time' | |
] | |
def self.converted_zoho_attributes |
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 Spam | |
require 'zendesk_api' | |
def self.client | |
@client ||= ZendeskAPI::Client.new do |config| | |
config.url = "https://pediment.zendesk.com/api/v2" # e.g. https://mydesk.zendesk.com/api/v2 | |
config.username = "[email protected]" | |
config.password = "pedb00ks" | |
config.retry = true | |
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
{ | |
"height":2448, | |
"width":3264, | |
"md5":"8c6e38213c009aa62ccbfed210db7189", | |
"exif":{ | |
"EXIF ApertureValue":"None", | |
"Image ExifOffset":"204", | |
"EXIF ComponentsConfiguration":"YCbCr", | |
"GPS GPSLatitudeRef":"N", | |
"GPS GPSAltitudeRef":"0", |
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
singular = {cats: false} | |
multiple = [{cats: false}, {dogs: true}] | |
puts Array(singular).inspect #=> | |
[[:cats, false]] | |
## Desired output: [{cats: false }] | |
puts Array(multiple).inspect #=> | |
[{:cats=>false}, {:dogs=>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
// Use images up to 1.2x their size to save file weight | |
@1x Breakpoints: | |
0 - 288: small (240w) | |
289 - 576: medium (480w) | |
577 - 720: large (600w) | |
721 - *: 1024x1024 (1024w) | |
@2x Breakpoints: | |
0 - 288: medium (480w) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
ActiveSupport::Inflector.inflections(:en) do |inflect| | |
inflect.acronym "URL" | |
inflect.human /url/i, "url" | |
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
def [](attr_name) | |
instance_variable_get("@#{attr_name}") || super(attr_name) | |
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
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LOAD DATA INFILE '/Users/Bryan/Sites/rubyapps/pc_3.0/db/data/geoplanet_data_7.5.' at line 7: | |
CREATE TEMPORARY TABLE geoplanet_changes ( | |
woeid BIGINT(20) NOT NULL PRIMARY KEY, | |
replacement_woeid BIGINT(20) NOT NULL, | |
data_version VARCHAR(255) | |
); | |
LOAD DATA INFILE '/Users/Bryan/Sites/rubyapps/pc_3.0/db/data/geoplanet_data_7.5.1/geoplanet_changes_7.5.1.tsv' INTO TABLE geoplanet_changes | |
FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '"' | |
(woeid, replacement_woeid, data_version); |
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
CREATE TEMPORARY TABLE geoplanet_changes ( | |
woeid BIGINT(20) NOT NULL PRIMARY KEY, | |
replacement_woeid BIGINT(20) NOT NULL, | |
data_version VARCHAR | |
); | |
LOAD DATA INFILE 'infile.tsv' INTO TABLE geoplanet_changes | |
FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\"' | |
(woeid, replacement_woeid, data_version); |
NewerOlder