Skip to content

Instantly share code, notes, and snippets.

View syedsaqibali's full-sized avatar

Saqib Ali syedsaqibali

  • Washington DC, USA
View GitHub Profile
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt' : "%Y-%m-%d %H:%M:%S"
},
'simple': {
'format': '%(levelname)s %(message)s'
from django.core.mail import send_mail
import os
def sendMyAppEmail(toList, template, toType=None, subject="", templateDict={}):
# Load the image you want to send at bytes
img_data = open(os.path.join(settings.MEDIA_ROOT, 'bumblebee.jpeg'), 'rb').read()
# Create a "related" message container that will hold the HTML
$ brew install rethinkdb
Warning: A newer Command Line Tools release is available
The standalone package can be obtained from
https://developer.apple.com/downloads/,
or it can be installed via Xcode's preferences.
==> Downloading http://download.rethinkdb.com/dist/rethinkdb-1.11.3.tgz
Already downloaded: /Library/Caches/Homebrew/rethinkdb-1.11.3.tgz
==> ./configure --prefix=/usr/local/Cellar/rethinkdb/1.11.3 --fetch v8 --fetch p
==> make
Exception: Error 2 running xcode-select
% npm install
npm http GET https://registry.npmjs.org/scrypt
npm http GET https://registry.npmjs.org/hashring
npm http 200 https://registry.npmjs.org/hashring
npm http 200 https://registry.npmjs.org/scrypt
> scrypt@1.7.4 install ~myUser/MyApp/snapstyle/snapstyle_app/node_modules/scrypt
> node-gyp rebuild
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.
{
"name": "snapstyle-api",
"private": true,
"version": "0.0.1",
"dependencies": {
"apn": "~1.4.3",
"batch-request": "~0.0.7",
"bluebird": "~1.0.4",
"ejs": "~0.8.5",
"express": "~3.4.7",
npm ERR! Failed at the scrypt@1.7.4 install script.
npm ERR! This is most likely a problem with the scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls scrypt
% npm owner ls scrypt
$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
/Users/myUser/my_rails_app/config/initializers/logger.rb:16:in `call'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activesupport-4.0.8/lib/active_support/tagged_logging.rb:21:in `call'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/logger.rb:491:in `format_message'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/logger.rb:378:in `add'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activesupport-4.0.8/lib/active_support/logger.rb:14:in `block (2 levels) in broadcast'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/1.9.1/logger.rb:399:in `debug'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-4.0.8/lib/rails/rack/logger.rb:31:in `call_app'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/railties-4.0.8/lib/rails/rack/logger.rb:20:in `block in call'
/Users/myUser/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/activesupport-4.0.8/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/myUser/.rb
irb(main):002:0> require 'bigdecimal'
=> true
irb(main):003:0> v = BigDecimal("7.1762")
=> #<BigDecimal:7f8905213dc0,'0.71762E1',18(18)>
irb(main):004:0> v.truncate(2).to_s('F')
=> "7.17"
irb(main):005:0> w = BigDecimal("4.2")
=> #<BigDecimal:7f890522c5f0,'0.42E1',18(18)>
irb(main):006:0> w.truncate(2).to_s('F')
=> "4.2"
$ cat /etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)