Skip to content

Instantly share code, notes, and snippets.

headers = {}
headers['X-MJ-CustomID'] = 'rubyPR_Test_ID_1469790724'
email = { from_email: "[email protected]",
from_name: "Mailjet TEST",
subject: 'Your email flight plan 23!',
text_part: 'Dear passenger 1, welcome to Mailjet! May the delivery force be with you!',
html_part: '<h3>Dear passenger 1, welcome to Mailjet!</h3><br />May the delivery force be with you!',
recipients: [{:email => '[email protected]'}],
CustomID: '1234567890',
headers: headers
@electronicbites
electronicbites / export_products.sql
Created July 9, 2017 20:32
Export WooCommerce Products (Postgres)
DROP FUNCTION thumbnail_for_post(_postid numeric);
CREATE FUNCTION thumbnail_for_post(_postid numeric) RETURNS text
AS $$
#print_strict_params on
DECLARE
thumbnail text;
BEGIN
payment = Adyen::API::PaymentService.new({
merchant_account: @merchant_account,
reference: @reference_text,
amount: {
currency: @currency,
value: @amount_cents,
},
shopperEmail: @user.email,
shopperReference: @user.id.to_s,
shopper: {
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Noshow Calculator</title>
<style id="jsbin-css">
.font16 {
font-size: 16px;
}
@electronicbites
electronicbites / index.html
Created March 5, 2017 15:05
Noshow Calculator // source http://jsbin.com/bitosep
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Noshow Calculator</title>
</head>
<body>
<div id="container">
<div id="calcHeader">
<?xml version="1.0" encoding="UTF-8"?>
<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:body>
<recurring:listrecurringdetailsresponse xmlns:recurring="http://recurring.services.adyen.com">
<recurring:result>
<creationdate xmlns="http://recurring.services.adyen.com">
2017-02-16T16:13:14+01:00
</creationdate>
<details xmlns="http://recurring.services.adyen.com">
<recurringdetail>
<div id="logoheader"></div>
<div id="pmcontent">
<input type="hidden" name="shopperEmail" value="[email protected]" />
<input type="hidden" name="shopperReference" value="grasshopper52" />
<input type="hidden" name="recurringContract" value="RECURRING" />
@electronicbites
electronicbites / update_ruby.sh
Last active July 19, 2017 14:16
update ruby to with rbenv
cd ~/.rbenv && git pull
cd ~/.rbenv/plugins/ruby-build && git pull && cd -
rbenv install 2.2.7
rbenv local 2.2.7
gem install bundler
class HardWorker
include Sidekiq::Worker
sidekiq_options queue: :default, backtrace: true, retry: 6
def perform(name, count)
1000.times do |i|
logger.error "HardWorker #{i}, #{rand(i)}"
y = i * i / 3
z = i / 5
x = Math.sin(i) + Math.cos(i)
@electronicbites
electronicbites / seatris-button-1.html
Created July 9, 2016 16:04
html snippet for seatris button
<a href="https://bookings.finediningexperiences.com/restaurants/freebirdbkk">
<img src="http://finedining-production.s3.amazonaws.com/buttons/seatris-blue.png">
</a>