Skip to content

Instantly share code, notes, and snippets.

View sousousore1's full-sized avatar

Soichi Saito sousousore1

View GitHub Profile
@sousousore1
sousousore1 / client.js
Last active July 23, 2018 11:50
How to connect to actioncable server via actioncable client of npm package when using devise_token_auth gem.
import ActionCable from 'actioncable'
const buildUrl = (url, parameters) {
var qs = ''
for (var key in parameters) {
var value = parameters[key]
qs += encodeURIComponent(key) + '=' + encodeURIComponent(value) + '&'
}
if (qs.length > 0) {
qs = qs.substring(0, qs.length - 1)
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@sousousore1
sousousore1 / dabblet.css
Created February 10, 2012 03:17
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #0f0;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;