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 { Injectable } from '@nestjs/common'; | |
import { | |
AuthenticationDetails, | |
CognitoUser, | |
CognitoUserPool, | |
CognitoUserSession, | |
} from 'amazon-cognito-identity-js'; | |
import { AuthConfig } from './auth.config'; | |
@Injectable() |
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 { BadRequestException, Body, Controller, Post } from '@nestjs/common'; | |
import { AuthService } from './auth.service'; | |
@Controller('auth') | |
export class AuthController { | |
constructor(private readonly authService: AuthService) {} | |
@Post('login') | |
async login(@Body() authenticateRequest: { name: string; password: string }) { | |
try { |
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 { Injectable } from '@nestjs/common'; | |
@Injectable() | |
export class AuthConfig { | |
public userPoolId: string; | |
public clientId: string; | |
public region: string; | |
public authority; | |
constructor() { |
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
// type-defs.ts | |
import { gql } from 'apollo-server-express'; | |
export const typeDefs = gql` | |
type Person { | |
name: String! | |
born: Int! | |
actedInMovies: [Movie!]! @relationship(type: "ACTED_IN", properties: "ActedIn", direction: OUT) | |
directedMovies: [Movie!]! @relationship(type: "DIRECTED", direction: OUT) | |
} |
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
export const gqlProviderFactory = async () => { | |
const { NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD } = process.env; | |
const driver = neo4j.driver( | |
NEO4J_URI, | |
neo4j.auth.basic(NEO4J_USERNAME, NEO4J_PASSWORD) | |
); | |
const neoSchema = new Neo4jGraphQL({ |
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
#!/bin/bash | |
# define collections that you want to export. if not defined, nothing will be exported | |
COLLECTIONS=(collection1 collection2 collection3) | |
# database access | |
DB_HOST=${1-'127.0.0.1'} | |
DB_NAME=${2-'main'} | |
DB_PORT=${3-'27017'} | |
DB_USER=${4-'root'} | |
DB_PASS=${5-''} |
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
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE | |
f770fc671f11 12 seconds ago apt-get install -y curl 21.3 MB | |
28445c70c2b3 39 seconds ago apt-get install ping 11.57 MB | |
8dbd9e392a96 7 months ago 131.5 MB | |
$ docker tag 2844 imagename # <-- that's the secret right there | |
$ docker history imagename | |
IMAGE CREATED CREATED BY SIZE |
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
#!/usr/bin/env bash | |
BASE='/var/www/' | |
DRUPAL_PROJECTS=('drupalProject1' 'drupalProject2' 'drupalProject3' 'drupalProject4') | |
RELEASE_NAME="release-$(date +'%Y-%m-%d')" | |
echo $RELEASE_NAME | |
for DRUPAL_SITE in ${DRUPAL_PROJECTS[*]} | |
do |
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
<?php | |
$mp = Mixpanel(MIXPANEL_KEY); | |
$path = '/path/to/user/list.csv'; | |
$row = 1; | |
if (($handle = fopen($path, "r")) !== FALSE) { | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
// skip header line |
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
// Place in theme file, eg. mytheme/js/script.js | |
(function($, Drupal, window, document, undefined) { | |
Drupal.behaviors.bootstrap_based_theme = { | |
attach : function(context, settings) { | |
// Fix collapsible bug. | |
$(".collapse").on("hidden.bs.collapse", function() { | |
if ($(this).hasClass("in")) { |