Skip to content

Instantly share code, notes, and snippets.

View yulioaj290's full-sized avatar

Yulio Aleman Jimenez yulioaj290

View GitHub Profile
@yulioaj290
yulioaj290 / [...app_path].js
Created July 24, 2022 18:10
Link previews in React.js for Social Networks using Next.js
import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import Head from 'next/head'
import axios from 'axios'
export default function AppPath({ appPath, title, keywords, description }) {
const [originUrl, setOriginUrl] = useState('')
const router = useRouter()
useEffect(() => {
@mmikhan
mmikhan / tailwind.config.js
Created June 17, 2020 14:12
Tailwind CSS `grid-template-columns: auto-fit; grid-template-columns: auto-fill;` and `grid-template-rows: auto-fit; grid-template-rows: auto-fill;`
module.exports = {
purge: [],
theme: {
extend: {
gridTemplateColumns: {
'auto-fit': 'repeat(auto-fit, minmax(0, 1fr))',
'auto-fill': 'repeat(auto-fill, minmax(0, 1fr))',
},
gridTemplateRows: {
'auto-fit': 'repeat(auto-fit, minmax(0, 1fr))',
@ictus4u
ictus4u / run.tpl
Last active March 22, 2024 21:50 — forked from efrecon/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}
@rjerue
rjerue / Popover.js
Last active January 27, 2021 02:07
React Native Web Popovers
// web
import P, { ArrowContainer } from 'react-tiny-popover'
import React from 'react'
export default ({
visible = false,
position,
onClose,
children,
content = null,
@yulioaj290
yulioaj290 / NPM_UPLOADER.sh
Last active September 28, 2019 18:52
This script split a file into chunks, create a NPM package with each one, and finally upload each package to https://npmjs.com
#!/bin/bash
#
# Copyright 2019 Yulio Aleman Jimenez (@yulioaj290)
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in
@MauricioMoraes
MauricioMoraes / access_postgresql_with_docker.md
Last active May 27, 2024 01:21
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@troyharvey
troyharvey / .gitlab-ci.yml
Last active January 8, 2024 00:38
Deploy Google Cloud Functions: GitLab CI/CD Pipeline Config File
# Update Jan 2024
# Deploying Cloud Functions is much simpler than it was 6 years ago.
# I'm leaving the gist in it's original 2018 state for now,
# but skip the the recent comments below for a simpler solution.
variables:
GCP_ZONE: us-central1-a
stages:
- npm-install
@erikyuntantyo
erikyuntantyo / react-native-offline-bundling-android
Last active October 29, 2023 06:36
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
@j-jith
j-jith / miui-fastboot-howto.rst
Last active May 17, 2024 11:34
How to flash MIUI Fastboot ROM from Linux

How to flash MIUI Fastboot ROM from Linux

@vmasto
vmasto / twitter-react-redux-email.txt
Last active August 3, 2023 22:34 — forked from fat/email.txt
Twitter's React/Redux application architecture
Hey,
This is the redux video series that helped me learn how to use it: https://egghead.io/courses/getting-started-with-redux. And here's a section on react "stateless functions": https://facebook.github.io/react/docs/reusable-components.html#stateless-functions
Later you might want to play around with React Native
React Native for Web: https://github.com/necolas/react-native-web
Try it out here: http://codepen.io/necolas/pen/PZzwBR/?editors=0010
And I thought you might get some ideas from what we're doing for mobile.twitter.com, which is a bit like this...