View fusionauth.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/strategies/fusionauth.rb | |
require 'omniauth-oauth2' | |
module OmniAuth | |
module Strategies | |
class Fusionauth < OmniAuth::Strategies::OAuth2 | |
# Give your strategy a name. | |
option :name, "fusionauth" | |
# This is where you pass the options you would pass when |
View sessions_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Need to overwrite controller to make a devise-two-factor work with devise_token_auth | |
# @see https://github.com/lynndylanhurley/devise_token_auth/blob/master/app/controllers/devise_token_auth/sessions_controller.rb | |
class SessionsController < DeviseTokenAuth::SessionsController | |
def create | |
# Check | |
field = (resource_params.keys.map(&:to_sym) & resource_class.authentication_keys).first | |
@resource = nil | |
if field |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const Mailchimp = require('mailchimp-api-v3'); | |
// Listens for new firebase signups | |
exports.addMailchimpSubscriber = functions.auth.user().onCreate((user) => { | |
const mailchimp = new Mailchimp('{API-KEY}'); | |
mailchimp.post('/lists/{listID}/members', { |
View bitbucket-pipelines.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:8.7.0 | |
pipelines: | |
default: | |
- step: | |
caches: | |
- node | |
script: | |
- npm install | |
- npm install yarn grunt -g |
View alloyEditor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Alloy editor component | |
*/ | |
angular.module('myApp').component('alloyEditor', { | |
template: '<div id="alloyeditor"></div>', | |
require: { | |
ngModel: 'ngModel' | |
}, |
View app.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
@Component({ | |
selector: 'my-app', | |
template: ` | |
<h1 i18n>Hello world</h1> | |
<p i18n="example description">This is an {{details}} paragraph</p> | |
<p>should not be translated</p> | |
<p i18n>I ❤ LingoHub</p> | |
` | |
}) |
View angular-file-upload-blob.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show preview of cropped image | |
*/ | |
uploader.onAfterAddingFile = function(item) { | |
$scope.cropped = {image: ''}; | |
var reader = new FileReader(); | |
reader.onload = function(event) { | |
$scope.$apply(function(){ | |
$scope.cropped.image = event.target.result; | |
}); |
View trix_editor.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trix-toolbar .button_group button::before { | |
background-image: none !important; | |
font-family: 'FontAwesome'; | |
font-size: 12px; | |
line-height: 28px; | |
} | |
trix-toolbar .button_group button.bold:before { | |
content: '\f032'; | |
} |
View croppieDrct.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use Croppie for a simple image cropping. | |
* @see https://github.com/Foliotek/Croppie | |
* @example | |
* <lh-croppie src="cropped.source" ng-model="cropped.image"></lh-croppie> | |
*/ | |
angular.module('lingohubApp').directive('lhCroppie', function () { | |
return { | |
restrict: 'E', | |
scope: { |
View google_feed_api_deprecated.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BEFORE | |
var feedUrl = 'https://lingohub.com/blog/feed/rss2'; | |
$http.jsonp('https://ajax.googleapis.com/ajax/services/feed/load', {params: {v: '1.0', q: feedUrl, num:-1, callback:'JSON_CALLBACK'}}).success(function(data) { | |
$scope.entries = data.responseData.feed.entries; | |
angular.forEach($scope.entries, function (entry) { | |
entry.publishedDate = new Date(entry.publishedDate); | |
}); | |
}); |
NewerOlder