Skip to content

Instantly share code, notes, and snippets.

Avatar
🏳️‍🌈

Wout wout

🏳️‍🌈
View GitHub Profile
@wout
wout / cli.js
Created Sep 13, 2022 — forked from mattdesl/cli.js
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
View cli.js
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
@wout
wout / vim-cheats.md
Created Aug 20, 2022 — forked from Starefossen/vim-cheats.md
My vim cheat sheet for working with tabs and window splits.
View vim-cheats.md

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab
@wout
wout / haskell-language-extensions.md
Created Aug 18, 2022 — forked from mightybyte/haskell-language-extensions.md
A Taxonomy of Haskell Language Extensions
View haskell-language-extensions.md

Haskell Language Extension Taxonomy

Caveat: It's just personal opinion, and was written to be a bit provocative and encourage discussion . It is also something that is constantly evolving. Some of the main criteria I used in constructing this taxonomy are age, how widely used it us, and how well understood it is by the average Haskell programmer. These things will change over time.

Aso, this is focused on appropriateness for use in commercial production code bases. If you are not thinking about commercial use with a team of multiple

@wout
wout / keychron K3.md
Created Jul 25, 2022 — forked from aleixmorgadas/keychron K3.md
Keychron K3 Linux
View keychron K3.md
View dendro-app-structure.md

DendroRithms App Structure

Introduction

The app is written in Crystal using Lucky Framework (https://luckyframework.org/). It's a batteries-included web framework that makes heavy use of compile-time checks. As a result, it's very helpful in tracking errors and catching bugs even before the app reaches runtime.

Lucky is also extremely fast compared to similar frameworks written in other programming languages. The following benchmark illustrates it well:

https://www.techempower.com/benchmarks/#section=data-r20&hw=ph&test=plaintext&l=zdk2rj-sf&f=zik06v-zik073-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-zik0zj-yelngf-cn3

Structure

@wout
wout / WebhookTutorial.md
Created Dec 19, 2021 — forked from jagrosh/WebhookTutorial.md
Simple Webhook Tutorial (Twitter -> Discord)
View WebhookTutorial.md

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel

Step 1 - Register on Zapier

  1. Go to https://zapier.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets
@wout
wout / SublimeText-Project-Line-Count
Created Dec 11, 2021 — forked from halcarleton/SublimeText-Project-Line-Count
Count total lines of code in a Sublime Text Project or Directory
View SublimeText-Project-Line-Count
Go to menu:
Find -> Find in Files... (windows: ctrl+shift+f)
Switch on reg_ex button (windows: alt+r)
Find:
^.*\S+.*$
Where:
c:\your_folder\,*.php,*.js,*.inc,*.html,*.htm,*.scss, -*/folder_to_exclude/*, -*.min.js
@wout
wout / haskellmind.hs
Last active Jun 3, 2021
Haskellmind: A Haskell CLI implementation of Mastermind
View haskellmind.hs
import System.Random
import Data.Char (isDigit)
makeCode :: IO [Char]
makeCode = do
gen <- newStdGen
return $ take 4 (randomRs ('0','9') gen)
breakCode :: String -> Int -> IO ()
breakCode code turns = do
@wout
wout / create_spec.rb
Created Nov 21, 2020 — forked from niinyarko/create_spec.rb
Request Spec Example for Devise Token Auth Gem with Rails 5.1
View create_spec.rb
# Example Request
# My Devise model is named Merchant
# Key lines to note are 16, 21, 27, 28, 29
require 'rails_helper'
RSpec.describe 'POST /api/v2/customer_groups', type: :request do
let(:merchant) { FactoryGirl.create(:merchant) }
let(:user) { FactoryGirl.create(:user) }
let(:customer) { merchant.customers.create(user_id: user.id)}
let(:params) {{
@wout
wout / rails-docker-compose.md
Created Oct 6, 2020 — forked from vuongpd95/rails-docker-compose.md
docker-compose for Rails application on Local
View rails-docker-compose.md
# docker/webapp/Dockerfile
FROM ruby:2.6.6

SHELL ["/bin/bash", "-c"]
RUN apt-get update -qq && apt-get install -y postgresql-client memcached tzdata nano
# Install node 12, yarn
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list