Skip to content

Instantly share code, notes, and snippets.

kzjeef / cpp
Last active Sep 20, 2021
async call example of gmock & gtest
View cpp
#include <iostream>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
using ::testing::_;
using ::testing::AtLeast; // #1
using ::testing::Ge;
using ::testing::NotNull;
using ::testing::StrictMock;
View ejabberd_auth.rb
#!/usr/bin/env ruby
require 'logger'
require 'rest_client'
$stdout.sync = true
$stdin.sync = true
path = "/usr/local/var/log/ejabberd/auth.log"
file =, File::WRONLY | File::APPEND | File::CREAT)
kzjeef / gist:9565261
Created Mar 15, 2014
simple token auth user model, this is an comment code from :
View gist:9565261
class User < ActiveRecord::Base
before_save :ensure_authentication_token
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable, :timeoutable,
:recoverable, :rememberable, :trackable, :validatable, :lockable
def ensure_authentication_token