Skip to content

Instantly share code, notes, and snippets.

View SalcidoJesus's full-sized avatar
🎧
chabo truste

SalcidoJesus

🎧
chabo truste
View GitHub Profile
@Klerith
Klerith / random-hex.md
Created September 22, 2023 17:47
Secure Random Hex

Comando con Ruby instalado

ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'

Ejemplo: No usar en producción

4510c8cf2fe423f8be5afccbdd30c678677e172b

@codigoconjuan
codigoconjuan / CategoriaSeeder.php
Created January 19, 2023 20:22
Seeder de Categorias para Laravel y React
DB::table('categorias')->insert([
'nombre' => 'Café',
'icono' => 'cafe',
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
DB::table('categorias')->insert([
'nombre' => 'Hamburguesas',
'icono' => 'hamburguesa',
@codigoconjuan
codigoconjuan / Layout.jsx
Created January 18, 2023 17:10
CSS para React Modal
const customStyles = {
content: {
top: "50%",
left: "50%",
right: "auto",
bottom: "auto",
marginRight: "-50%",
transform: "translate(-50%, -50%)",
},
};
@Klerith
Klerith / Dockerfile
Last active June 24, 2025 05:15
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Build the app with cache dependencies
FROM node:18-alpine3.15 AS builder
@david-arteaga
david-arteaga / Screen.tsx
Last active September 5, 2024 20:44
[React Native SafeAreaView, KeyboardAvoidingView, ScrollView] The best way to handle safe areas and keyboard in a scroll view #react-native #SafeAreaView #ScrollView #KeyboardAvoidingView
import React from 'react';
import {
SafeAreaView,
StyleSheet,
KeyboardAvoidingView,
ScrollView,
Platform,
} from 'react-native';
export default function Screen() {
@BjornDCode
BjornDCode / gist:5cb836a6b23638d6d02f5cb6ed59a04a
Created February 3, 2020 11:58
Tailwind - Fixed sidebar, scrollable content
// Source: https://twitter.com/calebporzio/status/1151876736931549185
<div class="flex">
<aside class="h-screen sticky top-0">
// Fixed Sidebar
</aside>
<main>
// Content
</main>

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@robertpeteuil
robertpeteuil / GitHub Language Colors in CSS and JSON
Last active June 2, 2025 00:04
GitHub Language Colors in CSS and JSON
This Gist contains the GitHub Language colors in CSS and JSON formats in seperate files.