Skip to content

Instantly share code, notes, and snippets.

@Gazzell
Gazzell / .eslintrc
Last active January 31, 2024 18:28
React, typescript, use craco to set custom tests paths and import aliases
{
"extends": [
"eslint-config-react-app"
],
"plugins": ["react", "import"],
"rules": {
"import/no-unresolved": "error"
},
"settings": {
"import/parsers": {
import withData from '@/lib/withData'
import { ApolloClient } from 'apollo-boost'
import App, { AppProps, Container } from 'next/app'
import { ApolloProvider } from 'react-apollo'
export default withData(
class extends App<MyAppProps> {
public static async getInitialProps({ Component, ...ctx }) {
let pageProps = {}
@lfades
lfades / Auth.js
Created October 11, 2018 19:06
Next.js Auth implementation: Apollo Server + Passport + Passport-jwt
/**
* server/dataSources/Auth.js
* Auth implementation, it's not really a dataSource so it doesn't need to be here
*/
const { authenticate, createJwt } = require('../lib/passport');
const { ON_HTTPS } = require('../configs');
const ONE_MINUTE = 1000 * 60;
const ONE_DAY = ONE_MINUTE * 60 * 24;
const ONE_MONTH = ONE_DAY * 30;
@pieterdv
pieterdv / get-aad-token.js
Created May 30, 2018 12:01
Login through Azure AD with puppeteer
function getAadToken(user, password, identifier) {
return puppeteer.launch({ headless: true }).then(async browser => {
try {
const page = await browser.newPage();
await page.goto("SITEURL");
await page.click(
"LOGINBUTTON"
);

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals

@zmts
zmts / tokens.md
Last active June 13, 2024 15:34
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@thornbill
thornbill / .gitlab-ci.yml
Created November 22, 2016 21:29
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
@vanderlin
vanderlin / Sublime Text 3 Command
Last active March 21, 2023 07:49
Create a Sublime Text 3 symbolic link to open a file via command line. paste this into terminal and now you can run `subl .` to open the directory in sublime or `subl file.html`
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl