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
16:14 ~/testcases/rails/my_app:(master) [ex:][ruby-2.4.4@my_app]$ gd config/environments/production.rb | |
diff --git a/config/environments/production.rb b/config/environments/production.rb | |
index 692320f..3bb605a 100644 | |
--- a/config/environments/production.rb | |
+++ b/config/environments/production.rb | |
@@ -23,7 +23,7 @@ Rails.application.configure do | |
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? | |
# Compress JavaScripts and CSS. | |
- config.assets.js_compressor = :uglifier |
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'; | |
/* @flow */ | |
const nconf = require('nconf'); | |
nconf.env() | |
.file({ file: 'api-keys.json' }); | |
const AWS = require('aws-sdk'); | |
AWS.config.apiVersions = { | |
sns: '2010-03-31', |
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 String | |
def alpha? | |
('a'..'z').cover?(downcase) | |
end | |
def letter_value | |
return 0 unless alpha? | |
('a'..'z').to_a.index(downcase) + 1 | |
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
iex(11)> Date.now | |
%Timex.DateTime{calendar: :gregorian, day: 12, hour: 15, minute: 28, month: 10, | |
ms: 34, second: 33, | |
timezone: %Timex.TimezoneInfo{abbreviation: "UTC", from: :min, | |
full_name: "UTC", offset_std: 0, offset_utc: 0, until: :max}, year: 2015} | |
iex(12)> Date.local | |
%Timex.DateTime{calendar: :gregorian, day: 12, hour: 8, minute: 30, month: 10, | |
ms: 519, second: 1, | |
timezone: %Timex.TimezoneInfo{abbreviation: "PDT", | |
from: {:sunday, {{2015, 3, 8}, {2, 0, 0}}}, full_name: "America/Los_Angeles", |
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
Yesterday I got similar results and couldn't access the site in a browser; today the browser is successful (!), but pings are as below: | |
10:12 ~[ruby-2.2.2]$ !406 | |
ping seneca.systems | |
PING seneca.systems (54.204.1.127): 56 data bytes | |
Request timeout for icmp_seq 0 | |
Request timeout for icmp_seq 1 | |
Request timeout for icmp_seq 2 | |
Request timeout for icmp_seq 3 | |
^C |
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 'net/http' | |
require 'open-uri' | |
require 'nokogiri' | |
url = "http://www.skin79mall.com/Search/" | |
params = {'id' => '1','SearchTxt' => '', 'hdLayerView' => '40'} | |
uri = URI.parse(url) | |
uri.query = URI.encode_www_form(params) | |
response = Net::HTTP.get_response(uri) |
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
RestClient.post( | |
"https://api.zotero.org/users/1994685/items?v=3&key=<mysecretkey>", | |
self.as_json, | |
:content_type => :json | |
) |
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
heroku db:push error (excerpted, this is where it fails): | |
products: 0% | | ETA: --:--:-- | |
Saving session to push_201103021709.dat.. | |
!!! Caught Server Exception | |
Taps::InvalidData: Detected data that exceeds the length limitation of its column. This is | |
generally due to the fact that SQLite does not enforce length restrictions. | |
Table : products | |
Column : is_unique |