View Editorjs.vue
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
<template> | |
<div class="editorjs" ref="htmlelement"></div> | |
</template> | |
<script setup> | |
import EditorJS from '@editorjs/editorjs'; | |
import EmbedTool from '@editorjs/embed'; | |
import ListTool from '@editorjs/list'; | |
import ImageTool from '@editorjs/image'; | |
import VideoTool from './editorjs/video.js'; | |
import { onMounted, onUnmounted, ref, watch } from 'vue'; |
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 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 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 1modalStateProvider.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
/** | |
* Modal provider. Adds state which will open a modal. | |
* Opens or closes modal on URL change. | |
*/ | |
app.provider('modalState', function($stateProvider) { | |
var provider = this; | |
var modalResult; | |
this.$get = function() { | |
return provider; | |
}; |
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 es6-classes-inheritance.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
/** | |
* Classes and Inheritance | |
* Code Example from http://www.es6fiddle.net/ | |
*/ | |
class Polygon { | |
constructor(height, width) { //class constructor | |
this.name = 'Polygon'; | |
this.height = height; | |
this.width = width; | |
} |
View bookmarklet.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
/** | |
* redirect javascript bookmarklet | |
*/ | |
// javascript:location.href='http://example.com/?uri='+encodeURIComponent(location.href) | |
/** | |
* bookmarklet loaded on site | |
*/ | |
(function(){ |
View authInterceptor.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'; | |
/** | |
* Authentication with token and email for every server request. (Sets HTTP headers) | |
* | |
* This interceptor shows the error from the server (i18n key). | |
* Also sets global error variable if the request fails and redirects the user to '/' when he is not authorized. | |
* @see http://engineering.talis.com/articles/client-side-error-logging/ | |
*/ | |
app.factory('authInterceptor', function ($rootScope, $q, $cookies, $location, $timeout) { |
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'; | |
} |
NewerOlder