Skip to content

Instantly share code, notes, and snippets.

IP = `curl ipinfo.io/ip`.delete!("\n")
puts IP
curl_command = "curl -X PUT \"https://api.cloudflare.com/client/v4/zones/ZONEINFO/dns_records/DOMAIN_INFO\" \
-H \"X-Auth-Email: EMAIL\" \
-H \"X-Auth-Key: API_KEY\" \
-H \"Content-Type: application/json\" \
--data '{\"type\":\"A\",\"name\":\"domain\",\"content\":\"#{IP}\",\"proxied\":true}'\"\""
exec curl_command
function sendFormByEmail(e)
{
// Remember to replace this email address with your own email address
var email = "[email protected]";
var subject = "Hello Form";
var message = "";
var form = FormApp.getActiveForm();
var formResponses = form.getResponses();
@SwamiRama
SwamiRama / Dockerfile
Last active June 16, 2016 20:18
Phoenix in Docker
FROM elixir:latest
RUN apt-get update -qq && \
apt-get install -y \
build-essential \
libpq-dev \
nodejs \
npm \
git \
postgresql-client
@SwamiRama
SwamiRama / service_class
Created June 1, 2016 07:55
Create a service class
class TestClass
class << self
def perform(a:, b:)
instance = new(a, b)
instance.perform
end
end
def initialize(a:, b:)
end
@SwamiRama
SwamiRama / Dockerfile
Last active June 17, 2016 18:50
Rails in Docker
FROM ruby:2.3
MAINTAINER [email protected]
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-get update && \
apt-get install -y \
build-essential \
nodejs
@SwamiRama
SwamiRama / database.yml
Created February 6, 2016 17:39
Rails setup
development:
adapter: <%= ENV['adapter'] %>
encoding: <%= ENV['encoding'] %>
database: <%= ENV['database'] %>
host: <%= ENV['host'] %>
username: <%= ENV['username'] %>
password: <%= ENV['password'] %>
pool: 5
test: