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 GetData | |
@@logger = Logger.new('log.log') | |
def initialize | |
@yesterday = Date.today.prev_day | |
@token = xxx | |
end | |
def get_actions |
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
date = Date.today | |
scheduler.in '10d' do | |
something = Something.new(date) | |
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
class Trial | |
def check_activity | |
if activity > 100 | |
send_mail(Mailer) | |
end | |
end | |
def send_mail(mail) | |
mail.new(id, name, date, total_activity) | |
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
if trial? | |
scheduler = Rufus::Scheduler.new | |
date = Date.today | |
scheduler.in '10d' do | |
trial = Trial.new(customer[:id], customer[:name], date) | |
trial.check_activity | |
end | |
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
{ | |
"uid": "1VOa" | |
} | |
response: | |
{ | |
code: 200 | |
status: "Beacon recognized" | |
name: "Czarny" |
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
<div style="display: none;"> | |
<script type="text/javascript" src="//your.mautic.domain/form/generate.js?id=1"></script> | |
</div> | |
<script> | |
jQuery("input#billing_email").change(function() { | |
var customer_email = jQuery("input#billing_email").val(); | |
jQuery("input#mauticform_input_yourformname_email").val(customer_email) | |
jQuery("form#mauticform_yourformname").submit(); | |
}) |
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
{# you can replace 'default' with your blog id #} | |
{% set contents = blog_popular_posts('default', 200) %} | |
{# search query #} | |
{% set query = request.query_dict['q'] %} | |
<h1>Search results for: {{ query }}</h1> | |
{% for content in contents %} | |
{% if query|lower in content.name|lower %} | |
{# your blogpost listing, ex. <h2>{{ content.name }}</h2> #} |
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
<form action="http://example.com/search"> | |
<input type="search" name="q" placeholder="Search"> | |
</form> |
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
Inbound Contacts | |
Includes | |
Rule 1 | |
Rule 2 | |
Rule n | |
Excludes | |
Rule 1 | |
Rule 2 | |
Rule n |
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 'rest-client' | |
require 'json' | |
properties = File.open('./hubspot-contact-properties-list-shortened.txt') | |
request = "http://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=APIKEY&showListMemberships=true&formSubmissionMode=all&count=1000" | |
properties.each do |property| | |
request << "&property=#{property}" | |
end |
OlderNewer