Skip to content

Instantly share code, notes, and snippets.

@ZenCocoon
ZenCocoon / invite_slack_user_everywhere.rb
Created January 28, 2017 01:47
Invite a Slack user to every non archived channels and groups
require "slack-ruby-client"
token = ...
user_name = ...
Slack.configure do |config|
config.token = token
end
client = Slack::Web::Client.new
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("BookingSyncCalendarWidget",[],t):"object"==typeof exports?exports.BookingSyncCalendarWidget=t():e.BookingSyncCalendarWidget=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/assets/",t(t.s=13)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"g",function(){return d}),n.d(t,"n",function(){return u}),n.d(t,"l",function(){return g}),n.d(t,"c",function(){return h})
@ZenCocoon
ZenCocoon / _menu.liquid
Last active June 1, 2016 11:19
Handle sub-submenus with BookingSync generated websites
Replace:
``` liquid
<li><a href="{{ subitem.url }}">{{ subitem.title }}</a></li>
```
By:
``` liquid
@ZenCocoon
ZenCocoon / huboard-condensed-issues.css
Created January 13, 2016 05:56
Condensed HuBoard style
// Currently used with the bookmarklet http://www.paulirish.com/2008/bookmarklet-inject-new-css-rules/
.card { padding: 0 0 0 4px; margin-bottom: 0; border-bottom: 0 }
.card .title {
font-size: 12px;
line-height: 14px;
}
.card .hb-avatar-tooltip, .card .number { display: none; }
@ZenCocoon
ZenCocoon / bootstrap.datepicker.js
Created July 8, 2015 13:52
BookingSync version for the Bootstrap Datepicker. Adding support for availability map and more
/* ===========================================================
* bootstrap-datepicker.js v1.3.0
* http://twitter.github.com/bootstrap/javascript.html#datepicker
* ===========================================================
* Copyright 2011 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@ZenCocoon
ZenCocoon / booknow.liquid
Last active August 29, 2015 14:24
Live price check using BookingSync Javascript API v2
<form id="bs_booknow_form" action="{{ rental.booknow_url }}" method="get">
<input type="hidden" id="bs_booknow_rental_id" name="rental_id" value="{{ rental.bookingsync_id }}" />
<input type="hidden" id="bs_booknow_source" name="source" value="{{ site.domain }}" />
<input type="hidden" id="bs_booknow_include_tentative" name="include_tentative" value="{{ site.tentatives_as_available }}">
<div class="row">
<div class="col-xs-6 col-sm-12 col-md-6">
<div class="form-group date">
<label class="date control-label" for="bs_booknow_start_at">
{% t 'search.form.checkin' %}</label>
<input autocomplete="off" class="date form-control" data-datepicker=""
{
"links": {
"rentals.account": "https://www.bookingsync.com/api/v3/accounts/{rentals.account}",
"rentals.availability": "https://www.bookingsync.com/api/v3/availabilities/{rentals.availability}",
"rentals.destination": "https://www.bookingsync.com/api/v3/destinations/{rentals.destination}",
"rentals.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{rentals.rates_table}",
"rentals.rental_agreement": "https://www.bookingsync.com/api/v3/rental_agreements/{rentals.rental_agreement}",
"rentals.photos": "https://www.bookingsync.com/api/v3/photos/{rentals.photos}",
"rentals.reviews": "https://www.bookingsync.com/api/v3/reviews/{rentals.reviews}",
"rentals.special_offers": "https://www.bookingsync.com/api/v3/special_offers/{rentals.special_offers}",
@ZenCocoon
ZenCocoon / custom_inquiry_form
Last active August 29, 2015 14:20
BookingSync Custom/Self-Hosted Inquiry Form
<form accept-charset="UTF-8" action="https://www.bookingsync.com/en/mybookings/1/inquire" method="post">
<div style="display:none"><input name="utf8" type="hidden" value="✓"></div>
<label for="inquiry_rental_id">Rental</label>
<select id="inquiry_rental_id" name="inquiry[rental_id]">
<option selected="selected" value="1234">Villa Boubouki</option>
<option value="1235">Villa Anatoli</option>
<option value="1236">Villa Amoudia</option>
<option value="1237">Villa Sivota</option>
</select>
en:
locale_names:
af: "Afrikaans"
sq: "Albanian"
ar: "Arabic"
hy: "Armenian"
az: "Azerbaijani"
eu: "Basque"
be: "Belarusian"
bn: "Bengali"
@ZenCocoon
ZenCocoon / JSON API Compound Documents.json
Last active August 29, 2015 13:59
JSON API Compound Documents
{
"links": {
"posts.author": {
"href": "http://example.com/people/{posts.author}",
"type": "people"
},
"posts.comments": {
"href": "http://example.com/comments/{posts.comments}",
"type": "comments"
}