Skip to content

Instantly share code, notes, and snippets.

View juggy's full-sized avatar
🎯
Focusing

Julien Guimont juggy

🎯
Focusing
View GitHub Profile
@juggy
juggy / application.controller.js
Created August 28, 2015 18:40 — forked from patrickarlt/application.controller.js
ember-with-custom-events
import Ember from 'ember';
class ItemRating extends HTMLElement {
createdCallback () {
this.insertAdjacentHTML('afterbegin', `
<a data-rating="1">&#9733;</a>
<a data-rating="2">&#9733;</a>
<a data-rating="3">&#9733;</a>
<a data-rating="4">&#9733;</a>
<a data-rating="5">&#9733;</a>
class Core::PaginationSerializer < ActiveModel::ArraySerializer
def initialize(object, options={})
meta_key = options[:meta_key] || :meta
options[meta_key] ||= {}
pobject = options[:pagination_object] || object
options[meta_key][:pagination] = {
current_page: pobject.current_page,
next_page: pobject.next_page,
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'th',
downArrow: '&#9660;',
upArrow: '&#9650;',
actions: {
sortBy(model, sortProperty, order) {
// Remove all selected classes from all the header links
@juggy
juggy / Errors and Warnings.xml
Created March 14, 2010 18:46
Errors and warnings return value
<errors>
<error> Can't be saved </error>
</errors>
<warnings>
<warning> Cannot send msg, queue does not exist</warning>
</warnings>
@juggy
juggy / Show Queue URL
Created March 14, 2010 18:33
Get Queue Statuses
GET http://live.bolideapp.com/q.xml
GET http://live.bolideapp.com/q/<q_name>.xml
@juggy
juggy / Send Message URL
Created March 14, 2010 18:42
Create Message URL
POST http://live.bolideapp.com/msg.xml
@juggy
juggy / Read Message URL
Created March 14, 2010 18:44
Client URL to read a message
GET http://live.bolideapp.com/<account>/<queue_name>/<valid_token>
<!-- It uses prototype & the bolide.js found in the ruby plugin or at live.bolideapp.com -->
<script src="/javascripts/prototype.js?1267672430" type="text/javascript"></script>
<script src="http://live.bolideapp.com/js/bolide.js" type="text/javascript"></script>
<script type="text/javascript">
// With session ID and Token
bolide = new Bolide.Client("bolide", "b79c55c143df93241981c49aa97329f6", "cdcdaeb0-11c6-012d-0145-404077aa86f5", {
onSuccess: function(response){
print("Success", response);
},
@juggy
juggy / api auth.rb
Created March 14, 2010 19:06
API Auth
# Headers should be:
#
# X-Bol-Date: <Date of the request, format doesn't matter>
# X-Bol-Authentication: <MD5 Hash>
# Content-Type: application/xml
#
def headers
now = DateTime.now.to_s
{'X-Bol-Date'=>now, 'X-Bol-Authentication'=>auth_key(now), 'Content-Type'=>'application/xml'}
end
@juggy
juggy / Show Queue XML.xml
Created March 14, 2010 18:20
Bolide Q index XML
<qs account="bolide_account">
<q id="client_1">
<msg_count>0</msg_count>
<token>30b397d0-11c5-012d-0143-404077aa86f5</token>
<expire_on>2010-03-14T18:32:37+00:00</expire_on>
</q>
<q id="client_2">
<msg_count>3</msg_count>
<token>4b321ff0-11c5-012d-0143-404077aa86f5</token>
<expire_on>2010-03-14T19:32:37+00:00</expire_on>