spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
Your application is growing, and you are starting to have a complex mailing system: notification emails, retention emails, misc user emails, admin emails, etc...
It's time to clean up your mailers !
You may already have a single mailer, responsible of every emails, like this one:
This file contains 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
/*************************************************************************** | |
** This file is part of the generic algorithm library Wiselib. ** | |
** Copyright (C) 2008,2012 by the Wisebed (www.wisebed.eu) project. ** | |
** ** | |
** The Wiselib is free software: you can redistribute it and/or modify ** | |
** it under the terms of the GNU Lesser General Public License as ** | |
** published by the Free Software Foundation, either version 3 of the ** | |
** License, or (at your option) any later version. ** | |
** ** | |
** The Wiselib is distributed in the hope that it will be useful, ** |
This file contains 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
# build file written to describe the C and C++ source files to the Android NDK | |
LOCAL_PATH := $(call my-dir) | |
include $(CLEAR_VARS) | |
LOCAL_MODULE := debugTest | |
LOCAL_CXXFLAGS := -W | |
LOCAL_SRC_FILES := debug_test.cpp | |
#This definition is needed by wiselib | |
LOCAL_C_INCLUDES := /home/vasilakis/Development/wiselib/wiselib.testing/ \ | |
/home/vasilakis/Development/wiselib/wiselib.stable/ |
This file contains 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
var GMAPS = window.GMAPS || {}; | |
GMAPS.mainMap = function() { | |
var map; | |
var infowindow = new google.maps.InfoWindow(); | |
var jsonObject = {}; | |
function addMarkers() { | |
var xhr = new XMLHttpRequest(); | |
xhr.open( "GET", "/home.json", true ); | |
xhr.onreadystatechange = function () { |
This file contains 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
var GMAPS = window.GMAPS || {}; | |
GMAPS.mainMap = function() { | |
var map; | |
var infowindow = new google.maps.InfoWindow(); | |
var jsonObject = {}; | |
function addMarkers() { | |
var xhr = new XMLHttpRequest(); | |
xhr.open( "GET", "/home.json", true ); | |
xhr.onreadystatechange = function () { |
This file contains 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
class Api::V1::UsersController < Api::V1::BaseController | |
skip_before_filter :authenticate_user, only: [:create, :resetpassword] | |
def index | |
users = policy_scope(User) | |
render json: users, each_serializer: Api::V1::UserSerializer | |
end | |
def resetpassword |
This file contains 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 'benchmark' | |
@i=0 | |
def undefined_check | |
return @undefined_check += 2 if defined?(@undefined_check) | |
return @i += 1 | |
end | |
@nil = nil |
This file contains 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
class Hash | |
def reshape(binding) | |
new_hash = self.clone | |
new_hash.each{|k, v| new_hash[k] = (binding.instance_exec(&(v))) if v.is_a? Proc} | |
return new_hash | |
end | |
end | |
def foo_method |
This file contains 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 'git' | |
require 'fileutils' | |
require 'date' | |
begin | |
FileUtils.rm_rf('.git/') | |
File.delete('myfile.out') | |
rescue Errno::ENOENT | |
end |