Skip to content

Instantly share code, notes, and snippets.

View thiagosf's full-sized avatar
🏠
Always working at home

Thiago Silva Ferreira thiagosf

🏠
Always working at home
View GitHub Profile
@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@alexng353
alexng353 / nextjs.yml
Last active May 9, 2024 04:08
Next JS build test GitHub action
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Check NextJs build
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
@rsaryev
rsaryev / prisma-utils.ts
Last active May 28, 2024 11:27
Prisma analogue migrate rest command only programmatically, for testing purposes.
import { Prisma, PrismaClient } from '@prisma/client';
import { exec } from 'child_process';
import * as util from 'util';
const execPromisify = util.promisify(exec);
const prisma = new PrismaClient();
const tables = Prisma.dmmf.datamodel.models
.map((model) => model.dbName)
.filter((table) => table);
@dabit3
dabit3 / basicmarket.sol
Last active January 9, 2024 08:54
Basic NFT marketplace
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract NFT is ERC721URIStorage {
using Counters for Counters.Counter;
@johnfischelli
johnfischelli / App.js
Last active September 9, 2022 03:33
Flex Webchat UI Replace PreEngagment Form Example
import React from 'react';
import * as FlexWebChat from "@twilio/flex-webchat-ui";
import PreEngagementForm from './PreEngagementForm';
class App extends React.Component {
state = {};
constructor(props) {
super(props);
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@RussellBishop
RussellBishop / container-units-css-fuctions.scss
Last active December 30, 2019 20:46
Container Units CSS - SCSS Functions
@function columns($i) {
@return calc(#{$i} * var(--column-unit));
}
@function gutters($i) {
@return calc(#{$i} * var(--gutter-unit));
}
@function column-spans($i) {
@return calc(#{$i} * var(--column-and-gutter-unit) - var(--gutter-unit));
@airbornelamb
airbornelamb / convertmultiplemarkdown.md
Last active April 5, 2024 10:49
Systematic way to convert multiple markdown files to html
@troyharvey
troyharvey / deployment.yml
Last active July 20, 2024 10:05
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@atelierbram
atelierbram / convert-markdown-to-html-css-with-pandoc.md
Created April 2, 2017 10:46
Convert markdown files to html with Pandoc

Convert Markdown to html+css with Pandoc

Convert single markdown file to html from commandline:

  pandoc -f markdown -t html5 -o output.html input.md -c style.css

Convert multiple markdown files