Skip to content

Instantly share code, notes, and snippets.

View oliveiracdz's full-sized avatar

Daniel Oliveira oliveiracdz

View GitHub Profile
@deborahly
deborahly / expo_go_config.md
Created April 21, 2023 04:35
Procedure to expose Expo Go ports from WSL on Windows Firewall
  1. Save the content below to C:\scripts\wslbridge.ps1
  2. Run Powershell as Administrator
  3. From within Powershell, run powershell -ExecutionPolicy Bypass -File C:\scripts\wslbridge.ps1
  4. Get your windows IP with ipconfig
  5. Connect to your Windows IP (NOT THE WSL ONE) from the expo go on exp://<IP>:19000
# [Configuration]
# All the ports you want to forward separated by coma
$ports=@(7700,8088,8089,19000);
@austintackaberry
austintackaberry / modal.tsx
Created February 19, 2023 22:54
Plasmo Chakra UI Modal
import Calendar from "~components/Calendar"
import { useEffect, useRef, useState } from "react"
import cssTextFcDaygrid from "data-text:@fullcalendar/daygrid/main.css"
import cssTextFcCommon from "data-text:@fullcalendar/common/main.css"
import cssTextFcTimegrid from "data-text:@fullcalendar/timegrid/main.css"
import cssTextGlobals from "data-text:~styles/globals.css"
import {
ChakraProvider,
Modal,
ModalBody,
@brysonreece
brysonreece / tailwind.config.js
Created February 22, 2020 07:30
Tailwind Social Colors
// colors from materialui.co/socialcolors
module.exports = {
theme: {
colors: {
'facebook': '#3b5999',
'messenger': '#0084ff',
'twitter': '#55acee',
'linkedin': '#0077b5',
'skype': '#00aff0',
@Checksum
Checksum / websocket_proxy.js
Last active September 28, 2024 17:31
Intercepting WebSockets in the browser using JavaScript
const WebSocketProxy = new Proxy(window.WebSocket, {
construct(target, args) {
console.log("Proxying WebSocket connection", ...args);
const ws = new target(...args);
// Configurable hooks
ws.hooks = {
beforeSend: () => null,
beforeReceive: () => null
};
@jjxtra
jjxtra / HttpContext_RemoteIPAddress.cs
Last active October 26, 2024 05:42
C# / .NET core: Get Remote IP Address with Proxy / CDN Support
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace HttpContext_RemoteIPAddress
@mpowaga
mpowaga / docker-compose.yml
Created February 21, 2018 23:28
Mongo Replica Set with Docker Compose
version: "3"
services:
master:
image: mongo
links:
- slave
networks:
- mongo-cluster
volumes:
- ./init-repl-set.sh:/docker-entrypoint-initdb.d/init-repl-set.sh
@bolorundurowb
bolorundurowb / circle.yml
Last active February 28, 2022 12:29
A .NET/Dot Net Core 2.0 Circle CI configuration file (Uses CircleCI 1.0)
dependencies:
pre:
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-get update
- sudo apt-get install dotnet-sdk-2.0.2
override:
- dotnet restore
test:
@kcmr
kcmr / browsersync.conf.js
Created August 6, 2017 00:08
Browser Sync for a Polymer Web Component
const bs = require('browser-sync').create();
const componentPath = `/components/${__dirname.split('/').pop()}`;
bs.init({
files: [ '**/*.{html,js,css}' ],
open: false,
ghostMode: false,
startPath: `${componentPath}/demo/index.html`,
serveStatic: [{
route: componentPath,
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@javisperez
javisperez / interceptors.js
Last active December 4, 2022 16:47
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {