This file contains hidden or 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 'excon' | |
| Excon.defaults[:ssl_verify_peer] = false | |
| Excon.defaults[:ssl_ca_path] = ' /usr/lib/ssl' | |
| CarrierWave.configure do |config| | |
| if Rails.env.production? || Rails.env.staging? | |
| config.storage = :fog | |
| config.fog_credentials = { | |
| provider: 'AWS', |
This file contains hidden or 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
| ### Open cursors | |
| select max(a.value) as highest_open_cur, p.value as max_open_cur | |
| from v$sesstat a, v$statname b, v$parameter p | |
| where a.statistic# = b.statistic# | |
| and b.name = 'opened cursors current' | |
| and p.name = 'open_cursors' | |
| group by p.value; | |
| ### Find out the session that is causing the error by using the following SQL statement: | |
| select a.value, s.username, s.sid, s.serial# |
This file contains hidden or 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
| serialize :preferences | |
| #helper for using serialized values in form | |
| def self.serialized_attr_accessor(*args) | |
| args.each do |method_name| | |
| eval " | |
| def #{method_name} | |
| (self.preferences || {})[:#{method_name}] | |
| end | |
| def #{method_name}=(value) |
This file contains hidden or 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
| 1. download from https://docs.oracle.com/cd/E11882_01/install.112/e38228/inst_task.htm#BJFHJIBH | |
| - instantclient-basic-macos.x64-11.2.0.3.0.zip | |
| - instantclient-sqlplus-macos.x64-11.2.0.3.0.zip | |
| - instantclient-sdk-macos.x64-11.2.0.4.0.zip | |
| 2. unpack and place to /opt/oracle/instantclient_11_2 | |
| 3. set proper permissions | |
| 4. in ~/.bash_profile | |
| DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/oracle/instantclient_11_2 | |
| export DYLD_LIBRARY_PATH | |
| PATH=$PATH:/oracle/instantclient_11_2/ |
This file contains hidden or 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
| <!--RNMD:DATA:{"eid": "10.210.3.18.6b3b78f8-ec11-4a99-8906-b7976aad75c2"} ;END--> | |
| <VAST version="2.0"> | |
| <Ad id="2383240"> | |
| <InLine> | |
| <AdSystem>Rhythm NewMedia</AdSystem> | |
| <AdTitle>audi</AdTitle> | |
| <Description>Rhythm NewMedia</Description> | |
| <Impression id="Rhythm NewMedia"> | |
| <![CDATA[http://awsstageepg.aws.rnmd.net/adAck?requestId=102103181443020449282687&id=2383240&user=10.210.3.18.6b3b78f8-ec11-4a99-8906-b7976aad75c2&appId=tmzus_android&completed=100&trackingType=noQuartile]]></Impression> | |
| <Creatives> |
This file contains hidden or 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 'aws' | |
| AWS.config(:access_key_id => 'XXXXX', :secret_access_key => 'XXXXX') | |
| pipeline_id = 'XXXXXXX' | |
| preset_id = 'XXXXXX' | |
| s3 = AWS::S3.new | |
| bin = s3.buckets['XXXXXX-in'] | |
| bout = s3.buckets['XXXXXX-out'] |
This file contains hidden or 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
| <label class="switch"><input type="checkbox" checked><i></i></label> | |
| <label class="switch red"><input type="checkbox"><i></i></label> | |
| .switch input { | |
| display: none; | |
| } | |
| .switch i { | |
| display: inline-block; | |
| cursor: pointer; | |
| padding-right: 20px; |
This file contains hidden or 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
| - check run commands as login shell in terminal profile preferences after you install rvm and open new tab | |
| - `sudo apt-get install nodejs postgresql postgresql-contrib git npm phantomjs libpq-dev` | |
| - `sudo npm install bower -g` | |
| - `sudo ln -s which nodejs/usr/bin/node` | |
| - add ubuntu superuser: | |
| ubuntu@ubuntu-amd64:~/Sites/webapp$ sudo -i -u postgres | |
| postgres@ubuntu-amd64:~$ createuser --interactive | |
| Enter name of role to add: ubuntu |
This file contains hidden or 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 login_user_programatically | |
| # User or whatever the name of the model is that you're trying to authenticate | |
| @request.env['devise.mapping'] = Devise.mappings[:user] | |
| @resource = FactoryGirl.create(:confirmed_user) | |
| # The following two lines are where the magic happens. | |
| @auth_headers = @resource.create_new_auth_token | |
| @request.headers.merge!(@auth_headers) | |
| end |
This file contains hidden or 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
| // Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
| var fs = require('fs'); | |
| var AWS = require('aws-sdk'); | |
| AWS.config.loadFromPath('./aws-config.json'); | |
| var s3 = new AWS.S3(); | |
| // File | |
| var fileName = '5.pdf'; | |
| var filePath = './' + fileName; | |
| var fileKey = fileName; |