Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Set status

Wildan Zulfikar wzulfikar

💭
Set status
View GitHub Profile
@breadthe
breadthe / sd.sh
Created Sep 2, 2022
Stable Diffusion prompt script
View sd.sh
#!/bin/bash
echo -n "Enter a prompt: "
read prompt
echo -n "Steps (default 10): "
read steps
if [[ -z "$steps" ]]; then
steps=10
@izuolan
izuolan / worker.js
Last active Sep 8, 2022
Custom domain for your Craft.do pages. Demo: https://next-craft.vercel.app and Tutorial: https://zuolan.me/en/next_craft_en
View worker.js
// Your domain name
const MY_DOMAIN = 'note.example.com'
// Website language
const LANG = 'en'
// Favicon url
const FAVICON_URL = 'https://example.com/favicon.ico'
// Your config page link
@nandorojo
nandorojo / README.md
Last active Jul 6, 2022
Expo + Next.js Query Param state
View README.md

Expo + Next.js Query Params State 🦦

A typical use-case on web for maintaining React State is your URL's query parameters. It lets users refresh pages & share links without losing their spot in your app.

URL-as-state is especially useful on Next.js, since next/router will re-render your page with shallow navigation.

This gist lets you leverage the power of URL-as-state, while providing a fallback to React state for usage in React Native apps.

It's essentially a replacement for useState.

@wlib
wlib / LICENSE
Last active Jun 10, 2022
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
View LICENSE
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@dceddia
dceddia / CGPath+svg.swift
Last active Jul 3, 2022
Convert a CGPath to an SVG element with this Swift extension to CGPath
View CGPath+svg.swift
//
// CGPath+svg.swift
//
// Create an SVG element from a CGPath.
//
// Created by Dave Ceddia.
// MIT Licensed
//
// Inspired by: https://github.com/mro/MROGeometry/blob/master/MROGeometry/CGPathWriter.c
View 1_graphql_ruby_n_plus_one.md

How to run examples:

  1. Run $ createdb nplusonedb to create DB
  2. Run specs $ rspec demo.rb
@tadast
tadast / ruby.yml
Created Apr 26, 2020
Example github actions config for Rails with postgres using DATABASE_URL
View ruby.yml
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@fernandoaleman
fernandoaleman / mysql2-catalina.md
Last active Apr 26, 2022
Install mysql2 on MacOS Catalina
View mysql2-catalina.md

Problem

Installing mysql2 gem errors on MacOS Catalina with MySQL 5.7.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@tobiaslins
tobiaslins / worker.js
Last active Aug 9, 2022
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
View worker.js
const MY_DOMAIN = "help.splitbee.io"
const START_PAGE = "https://www.notion.so/splitbee/Help-Center-bbf26e2b70574901b9c98e5d11e449de"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@kentcdodds
kentcdodds / package.json
Last active Jul 6, 2022
Validates that the versions of tools specified in `engines` in the package.json are installed on the machine.
View package.json
{
"name": "workshop-computer-validator",
"version": "1.0.0",
"description": "I use this to validate people's computers have the proper versions of node and npm installed for a workshop",
"bin": "./validate-system.js",
"dependencies": {
"semver": "7.1.3"
}
}