- install dnsmasq
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
- edit
/usr/local/etc/dnsmasq.conf
address=/local/127.0.0.1
| # to run: | |
| # > elixir --no-halt udp_server.exs | |
| # to test: | |
| # > echo "hello world" | nc -u -w0 localhost 2052 | |
| # > echo "quit" | nc -u -w0 localhost 2052 | |
| # Let's call our module "UDPServer" | |
| defmodule UDPServer do | |
| # Our module is going to use the DSL (Domain Specific Language) for Gen(eric) Servers | |
| use GenServer |
$ brew install dnsmasq
...
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
/usr/local/etc/dnsmasq.confaddress=/local/127.0.0.1
This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.
This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)
Make sure you have the latest version of XCode installed. Available from the Mac App Store.
Install the Xcode Command Line Tools:
xcode-select --install
| # lib/paperclip/copy_attachments.rb | |
| # Copies S3-stored Paperclip attachments from one AR model to another. | |
| # | |
| # This module should be mixed into the target AR model. | |
| if Gem::Version.new(::AWS::VERSION) >= Gem::Version.new(2) | |
| raise NotImplementedError, 'coded for aws-sdk v1' | |
| end |
| #!/usr/bin/env python | |
| import Image, colorsys, sys | |
| if len(sys.argv) < 2: | |
| print 'usage: {} <file> [<output>]'.format(sys.argv[0]) | |
| sys.exit(0) | |
| img = Image.open(sys.argv[1]) | |
| width, height = img.size |
| class MyJob < ActiveJob::Base | |
| queue_as :urgent | |
| rescue_from(NoResultsError) do | |
| retry_job wait: 5.minutes, queue: :default | |
| end | |
| def perform(*args) | |
| MyService.call(*args) | |
| end |
| ### s3 implementation of Paperclip module that supports deep | |
| ### cloning of objects by copying image attachments. | |
| ### Refer to Paperclip issue: https://github.com/thoughtbot/paperclip/issues/1361#issuecomment-39684643 | |
| ### Original gist works with fog: https://gist.github.com/stereoscott/10011887 | |
| module Paperclip | |
| module CopyAttachments | |
| def copy_attachments_from(source_obj, source_bucket = nil, destination_bucket = nil) | |
| self.class.attachment_definitions.keys.each do |attachment_name| | |
| source_attachment = source_obj.send(attachment_name) |
| import Ember from 'ember'; | |
| Ember.Handlebars.registerHelper('component', function (name, options) { | |
| var context = (options.contexts && options.contexts.length) ? options.contexts[0] : this; | |
| if (options.types[0] === "ID") { | |
| name = Ember.Handlebars.get(context, name, options); | |
| } | |
| var container = options.data.view.container; | |
| var fullName = 'component:' + name; | |
| var templateFullName = 'template:components/' + name; |