Skip to content

Instantly share code, notes, and snippets.

@szTheory
szTheory / grunt-hugo-lunrjs.md
Created April 24, 2022 19:51 — forked from sebz/grunt-hugo-lunrjs.md
hugo + gruntjs + lunrjs = <3 search
@szTheory
szTheory / main.rb
Created December 28, 2021 18:39 — forked from amirrajan/main.rb
Spirit of Akina built with DragonRuby Game Toolkit
# Copyright 2021 Scratchwork Development LLC. All rights reserved.
PI = 3.1415926
class Game
attr_gtk
def tick
defaults
render
@szTheory
szTheory / tmux_italic.md
Created June 21, 2021 14:26 — forked from gyribeiro/tmux_italic.md
enable italic font on tmux
@szTheory
szTheory / installation.md
Last active January 6, 2021 03:18
Phoenix LiveView install for TypeScript

Phoenix LiveView doesn't include TypeScript install instructions since they don't maintain TypeScript support. Follow these additional steps to get it working:

  1. Install the unofficial NPM typings package to dev dependencies with:
npm install -D @types/phoenix_live_view
  1. Change:
@szTheory
szTheory / HOWTO.md
Created April 25, 2020 00:44
Generate Hex docs in .epub format (for example Ecto or Phoenix)
git clone https://github.com/elixir-ecto/ecto.git
cd ecto
MIX_ENV=docs mix docs -f epub
open docs/Ecto.epub
@szTheory
szTheory / keybindings.json
Last active February 2, 2020 18:19
Add a keyboard shortcut for Elixir pipeline operator |> in Visual Studio Code with the Macros extension
{
"key": "cmd+i",
"command": "macros.addPipeline"
}
@szTheory
szTheory / min-char-rnn.py
Created November 1, 2019 23:12 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@szTheory
szTheory / example.js
Created October 15, 2019 18:58
Rails UJS parameters as string. For submitting POST or PUT forms with ajax for Turbolinks
Rails.ajax({
type: 'GET',
url: '/users/' + <%= params[:id] %> + '/country',
// see: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
data: new URLSearchParams({'country': country}).toString(),
success: function (response) {
// ...
}
})