Skip to content

Instantly share code, notes, and snippets.

View sbellity's full-sized avatar

Stephane Bellity sbellity

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sbellity on github.
  • I am sbellity (https://keybase.io/sbellity) on keybase.
  • I have a public key ASA7KONqpmZwwWIWUIlFsxAFp5u7CN7uhXbFeuJyu501Zwo

To claim this, I am signing this object:

<script>
window.hullAsyncInit = function() {
Hull.ready(function() {
setTimeout(function() {
if (!Hull.currentUser()) {
Hull.emit('hull.login.showDialog');
}
}, 2000)
})
}
@sbellity
sbellity / force-display-modal.js
Created March 30, 2016 15:53
Display modal on page load and force reopen it on closed
window.hullAsyncInit = function() {
function showDialog() {
setTimeout(function() {
if (!Hull.currentUser()) {
Hull.emit('hull.login.showDialog');
}
}, 500);
}
// Show dialog on page load
Hull.on('hull.ships.ready', showDialog)

This tutorial walks you through the steps to implement a custom checkout flow that displays the login ship inside the cart drawer when an anonymous user clicks on the checkout button.

You can find an example of a similar flow here :

https://www.mvmtwatches.com/

Install the login ship and enable the "Show inline" option.

  • Enable the login ship from Hull's app page on your Shopify admin
  • Open the Hull dashboard to change the ship's default configuration
@sbellity
sbellity / testHook.js
Created July 24, 2015 09:16
My first hook.io microservice
module['exports'] = function echo (hook) {
// Access Node.js HTTP Request and Response objects
var req = hook.req,
res = hook.res;
// Use NPM Modules
var faker = require('faker');
res.write('<strong>hello</strong> ');
res.write(req.headers["x-forwarded-for"] + '<br/>');
res.end(faker.hacker.phrase());
};
@sbellity
sbellity / index.html
Last active August 29, 2015 13:56 — forked from anonymous/index.html
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://d3f5pyioow99x0.cloudfront.net/0.8/hull.js"></script>
<script>
@sbellity
sbellity / quiz-selector.html
Last active December 24, 2015 09:38
Hull Quiz Selector wrapper
<html>
<head>
<title>Quiz Selector</title>
<link rel="stylesheet" type="text/css" href="https://hullstrap.s3.amazonaws.com/stylesheets/hullstrap.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//hull-js.s3.amazonaws.com/0.6.15/hull.js"></script>
<script type="text/javascript">
Hull.component('quiz-selector', {
templates: ['quiz-selector'],
@sbellity
sbellity / hull-init.rb
Last active December 19, 2015 17:29
hull-rails initializer
require 'handlebars_assets'
Hull.configure do |config|
# == Hull App Config
#
config.app_id = ENV["HULL_APP_ID"]
# == Hull App secret
# This is required to enable all server side secure stuff.
@sbellity
sbellity / main.js
Created April 12, 2013 09:57
Hull Profile Widget with data coming from Facebook
Hull.widget('profile', {
templates: ['profile'],
refreshEvents: ['model.hull.me.change'],
fields: [
{ name: 'name', type: 'text', placeholder: 'Name' },
{ name: 'email', type: 'text', placeholder: 'Email' }
],
@sbellity
sbellity / achieve_button.hbs
Created January 3, 2013 19:01
Hull Default Widgets templates
{{#if isAchieved}}
<button class="btn btn-success">Checked</button>
{{else}}
<button class="btn {{#unless canAchieve}}disabled{{/unless}}" data-hull-action="achieve_button.achieve">CheckIn</button>
{{/if}}