Skip to content

Instantly share code, notes, and snippets.

View rodrigoespinozadev's full-sized avatar
🏠
Working from home

Rodrigo Espinoza rodrigoespinozadev

🏠
Working from home
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
GoRouter.setUrlPathStrategy(UrlPathStrategy.path);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
@wpo365
wpo365 / wpo365-samesite.php
Last active January 15, 2024 05:59
Plugin for WordPress websites that require a user to sign in (e.g. with Microsoft) and that are loaded inside an iframe (e.g. inside a Microsoft Teams App / Tab or similar). The plugin overrides the pluggable WordPress function wp_set_auth_cookie to set SameSite=None to enable third-party usage.
<?php
/**
* Plugin Name: WPO | SAMESITE
* Plugin URI: https://www.wpo365.com/downloads/wordpress-office-365-samesite/
* Description: Plugin for WordPress websites that require a user to sign in (e.g. with Microsoft) and that are loaded inside an iframe (e.g. inside a Microsoft Teams App / Tab or similar). The plugin overrides the pluggable WordPress function wp_set_auth_cookie to set SameSite=None to enable third-party usage.
* Version: 1.0
* Author: support@wpo365.com
* Author URI: https://www.wpo365.com/
* License: GPL2+
*/
@rohan20
rohan20 / flutter_google_maps_bottom_sheet.dart
Last active July 4, 2023 15:38
Flutter Google Maps Bottom Sheet
import 'package:flutter/material.dart';
class GoogleMapsClonePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
CustomGoogleMap(),
CustomHeader(),
import 'package:flutter/material.dart';
import 'custom_labeled_checkbox.dart';
class ParentChildCheckboxes extends StatefulWidget {
static const String routeName = 'parent-child-checkbox';
@override
_ParentChildCheckboxesState createState() => _ParentChildCheckboxesState();
}
@diyfr
diyfr / docker-compose.yml
Last active May 1, 2023 05:34
Basic secured configuration for Traefik V2.X
version: '3.5'
services:
proxy:
image: traefik:v2.1
# The official v2.0 Traefik docker image
container_name: proxy
networks:
- traefik
ports:
@50percentgrey
50percentgrey / apple.sh
Created January 29, 2020 19:11
Delete-Clean Unnecessary files / Apple / Xcode
#!/bin/bash
# Delete Archived Applications
rm -r ~/Library/Developer/Xcode/Archives/*/
# Delete Devired Data
rm -r ~/Library/Developer/Xcode/DerivedData/*/
# Delete Apple cached files
rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/
version: '3'
services:
nginx:
image: awsdemo-nginx:latest
ports:
- "80:80"
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
@rodrigoespinozadev
rodrigoespinozadev / aws-lambda-unzipper.py
Created January 8, 2019 18:43 — forked from msharp/aws-lambda-unzipper.py
unzip archive from S3 on AWS Lambda
import os
import sys
import re
import boto3
import zipfile
def parse_s3_uri(url):
match = re.search('^s3://([^/]+)/(.+)', url)
if match:
return match.group(1), match.group(2)
@paigen11
paigen11 / findUser.js
Created September 4, 2018 20:50
Passport local and Passport JWT authentication with custom callbacks examples with a user registration MERN service.
import passport from 'passport';
module.exports = app => {
app.get('/findUser', (req, res, next) => {
passport.authenticate('jwt', { session: false }, (err, user, info) => {
if (err) {
console.log(err);
}
if (info != undefined) {
console.log(info.message);
//npm modules
const express = require('express');
const uuid = require('uuid/v4')
const session = require('express-session')
const FileStore = require('session-file-store')(session);
const bodyParser = require('body-parser');
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const axios = require('axios');