This file contains hidden or 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 { Amplify, Auth, withSSRContext } from 'aws-amplify' | |
import { Auth as NuxtAuth } from '@nuxtjs/auth-next' | |
export interface AmplifyAuthSchemeOptions { | |
name: string | |
} | |
export default class AmplifyAuthScheme { | |
public $auth: NuxtAuth | |
public options: AmplifyAuthSchemeOptions |
This file contains hidden or 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "BuddyPolicy", | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListAllMyBuckets", | |
"s3:GetObject", | |
"s3:GetObjectAcl", |
This file contains hidden or 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
/* eslint-disable padded-blocks */ | |
export default class IOSFix { | |
constructor (options = {}) { | |
this.options = { | |
target: options.target || document, | |
doubleTapZoom: options.doubleTapZoom || true, | |
overscroll: options.overscroll || true, | |
overscrollExcl: options.overscrollExcl || [] | |
} |
This file contains hidden or 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 getUniq = (digits, nbTotalNumerics) => { | |
let numerics = '0123456789'; | |
let alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
let nbNumerics = 0; | |
let uniqCode = ''; | |
for (let i = digits; i > 0; --i) { | |
let forceNumeric = (i <= nbTotalNumerics && nbNumerics < nbTotalNumerics); | |
if ((forceNumeric || (Math.floor(Math.random() * 2) + 0) === 0) && nbNumerics < nbTotalNumerics) { |
This file contains hidden or 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
drawImage (context, image, width, height, posX = 0, posY = 0, rotate = 0) { | |
let rotation = rotate * (Math.PI / 180) | |
let translateX = posX + (width / 2) | |
let translateY = posY + (height / 2) | |
context.translate(translateX, translateY) | |
context.rotate(rotation) | |
context.drawImage(image, -(width / 2), -(height / 2), width, height) | |
context.rotate(-rotation) | |
context.translate(-translateX, -translateY) |
This file contains hidden or 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
# Reset local repo to the last commit | |
git reset --hard | |
# Reset local repo to a specified commit | |
git reset --hard <SOME-COMMIT> | |
# Check last commit on your local | |
git log -1 | |
# Get remote url used on your local |
This file contains hidden or 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
#! /usr/bin/env bash | |
# | |
# Provision script for Ubuntu 14.04 LTS | |
# ------------ | |
# | |
# Author: https://github.com/maoosi | |
# Includes: Apache, PHP, MySql, Git, Composer, NodeJS | |
# |
This file contains hidden or 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
@mixin blurryFix() { | |
-webkit-transform: translateZ(0); | |
-webkit-filter: blur(0); | |
} | |
.blurry-fix { | |
@include blurryFix(); | |
} |
This file contains hidden or 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
function throttle(callback, delay) { | |
var last; | |
var timer; | |
return function () { | |
var context = this; | |
var now = +new Date(); | |
var args = arguments; | |
if (last && now < last + delay) { | |
clearTimeout(timer); | |
timer = setTimeout(function () { |
This file contains hidden or 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
function debounce(callback, delay){ | |
var timer; | |
return function(){ | |
var args = arguments; | |
var context = this; | |
clearTimeout(timer); | |
timer = setTimeout(function(){ | |
callback.apply(context, args); | |
}, delay) | |
} |