main.cf:
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
apply plugin: 'com.android.library' | |
apply plugin: 'com.jfrog.artifactory' | |
apply plugin: 'maven-publish' | |
def packageName = 'codeinputlib' | |
def libraryVersion = '1.0.0' | |
buildscript { | |
repositories { | |
jcenter() |
import React from 'react'; | |
import axios from 'axios'; | |
import Rx from 'rxjs'; | |
export default class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
scores: [] | |
}; |
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
var amqp = require('amqplib/callback_api'); | |
// if the connection is closed or fails to be established at all, we will reconnect | |
var amqpConn = null; | |
function start() { | |
amqp.connect(process.env.CLOUDAMQP_URL + "?heartbeat=60", function(err, conn) { | |
if (err) { | |
console.error("[AMQP]", err.message); | |
return setTimeout(start, 1000); | |
} |
// takes a {} object and returns a FormData object | |
var objectToFormData = function(obj, form, namespace) { | |
var fd = form || new FormData(); | |
var formKey; | |
for(var property in obj) { | |
if(obj.hasOwnProperty(property)) { | |
if(namespace) { |
package com.mma.fingerprint; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.util.EnumMap; | |
import java.util.concurrent.LinkedBlockingQueue; |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
utc_to_local.py | |
Example of converting UTC to local time using python-dateutil. | |
https://pypi.python.org/pypi/python-dateutil | |
""" | |
from datetime import datetime |
$ ./manage.py shell | |
Python 2.7.5 (default, Aug 25 2013, 00:04:04) | |
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from followers.models import * | |
>>> john = User.objects.create_user('john', 'lennon@thebeatles.com', 'password') | |
>>> paul = User.objects.create_user('paul', 'mccartney@thebeatles.com', 'password') | |
>>> george = User.objects.create_user('george', 'harrison@thebeatles.com', 'password') | |
>>> ringo = User.objects.create_user('ringo', 'starr@thebeatles.com', 'password') |