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
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |
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
INSPIRATION: https://github.com/intridea/grape/issues/131#issuecomment-10413342 | |
File: config/application.rb | |
config.autoload_paths += %W(#{config.root}/app/api #{config.root}/app/api/*/*) | |
File: config/environments/development.rb | |
# Add below code before DummyApp::Application.configure BLOCK |
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
- Start Firefox ProfileManager on Ubuntu | |
CMD: /usr/lib/firefox/firefox -ProfileManager | |
- Create Profile | |
- Let's say, profile name is WebDriver | |
- Select the WebDriver Profile | |
- Start Firefox | |
- Install Firebug | |
- Close Firefox |
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
#!/bin/sh | |
## Script to clean old git branches | |
echo "Delete branches having last commit before 1st June 2015 - DRY_RUN=1 to show commands - ignore if execution" | |
echo "DRY_RUN=1 delete_branches_older_than.sh '2015-06-01'" | |
echo $DRY_RUN | |
echo $1 |
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
## Library Code | |
## Defines DSL to be used by Service Code | |
## in order to get properly consumed by Consumer | |
defmodule Nectar.ModelExtension do | |
defmacro __using__(_opts) do | |
quote do | |
Module.register_attribute(__MODULE__, :schema_changes, accumulate: true) | |
import Nectar.ModelExtension, only: [add_to_schema: 1] | |
@before_compile Nectar.ModelExtension | |
end |
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
diff --git a/product.ex b/product.ex | |
index 25efbae..21632ff 100644 | |
--- a/product.ex | |
+++ b/product.ex | |
@@ -1,3 +1,6 @@ | |
+## Library Code | |
+## Defines DSL to be used by Service Code | |
+## in order to get properly consumed by Consumer | |
defmodule Nectar.ModelExtension do | |
defmacro __using__(_opts) do |
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
nectarcommerce ~/elixir$ iex -S mix | |
## File Compilation Removed | |
iex(4)> a = Nectar.Product.changeset(%Nectar.Product{}, %{}); a.model.special; | |
nil | |
iex(5)> b = Ecto.Changeset.put_change(a, :special, true); b.changes.special; | |
true |
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
nectarcommerce ~/elixir$ mix phoenix.routes Nectar.Router | grep Favorite | |
favorite_path GET /favorites FavoriteProducts.FavoriteController :index |
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
## Library Code | |
## Defines DSL to be used by Service Code | |
## in order to get properly consumed by Consume | |
defmodule Nectar.RouterExtension do | |
defmacro __using__(_opts) do | |
quote do | |
Module.register_attribute(__MODULE__, :defined_routes, accumulate: true) | |
import Nectar.RouterExtension, only: [define_route: 1] | |
@before_compile Nectar.RouterExtension |
OlderNewer