Skip to content

Instantly share code, notes, and snippets.

View neilmarion's full-sized avatar

Neil Marion dela Cruz neilmarion

View GitHub Profile
@neilmarion
neilmarion / send
Last active January 4, 2016 07:49
Sending email to mcroldan08@gmail.com through postfix error
# sending to mcroldan08@gmail.com
5416 Jan 24 00:00:27 li387-184 postfix/smtp[25370]: 2AE56FAED: to=<mcroldan08@gmail.com>, relay=gmail-smtp-in.l.google.com[2a00:1450:4008:c01::1b]:25, delay=3.4, delays=0.04/0.05/0.86/2.4, ds n=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:4008:c01::1b] said: 550-5.7.1 [2400:8900::f03c:91ff:fe70:bb41 12] Our system has detected that 550-5.7.1 this mess age is likely unsolicited mail. To reduce the amount of spam 550-5.7.1 sent to Gmail, this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?h l=en&answer=188131 for 550 5.7.1 more information. s8si608207bkr.298 - gsmtp (in reply to end of DATA command))
# vim /var/log/mail.log
@neilmarion
neilmarion / feddit_crontab
Last active January 1, 2016 18:09
feddit crontabs
# Development
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/neilmarion/ROR/projects/feddit && rvm 2.0.0@feddit && RAILS_ENV=development bundle exec rake trend:newsletter --silent'
# Production
# Begin Whenever generated tasks for: /home/deployer/apps/feddit/releases/20131230142259/config/schedule.rb
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /bin/bash -l -c 'cd /home/deployer/apps/feddit/current && RAILS_ENV=production ~/.rbenv/shims/bundle exec rake trend:hot --silent'
@neilmarion
neilmarion / spec_helper.rb
Created December 28, 2013 07:12
Drop all Database on Every RSpec Specs When using Mongoid
config.before(:each) do
Mongoid::Sessions.default.collections.select {|c| c.name !~ /system/ }.each(&:drop)
end
@neilmarion
neilmarion / initialize_rails
Last active January 1, 2016 09:59
How I Initialize a Rails Project
rvm gemset create (gemset name)
rails new project
# install test and development gems
rails g rspec:install
# add the following lines to spec/spec_helper.rb do
require 'factory_girl'
require 'webmock/rspec'
SimpleCov.start 'rails'
puts 'started simplecov'
# end
@neilmarion
neilmarion / gist:7885892
Created December 10, 2013 04:53
Intent with image in Twitter Android
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file);
@neilmarion
neilmarion / gmail_filter
Created December 5, 2013 04:06
Gmail Get all Unread but not important
label:unread -is:important
@neilmarion
neilmarion / add_remove_plugins.sh
Created December 5, 2013 01:38
Commands to add or remove cordova plugins
$ cordova plugin add org.apache.cordova.geolocation
$ cordova plugin ls
# [ 'org.apache.cordova.geolocation' ]
$ cordova plugin rm org.apache.cordova.geolocation
@neilmarion
neilmarion / config.xml
Created December 4, 2013 00:07
Edit www/config.xml to disable phonegap firewall.
Change <access origin="http://127.0.0.1*"> to <access origin="*" />
@neilmarion
neilmarion / image_temp_src
Created December 2, 2013 03:35
Android temporary image src after capture
file:///storage/sdcard0/Android/data/com.example.android2/cache/<string_of_digits>.jpg
{
status: 'connected',
authResponse: {
accessToken: '...',
expiresIn:'...',
signedRequest:'...',
userID:'...'
}
}